This is state statute. It doesn’t matter what the governing documents say.
Each state is different.
Also, HOAs only have the authority to enforce what is in the governing documents, unless state or federal statute supercedes. Typically, they are not empowered to enforce local municipal code; that comes under the jurisdiction of the City.
That is probably why they caved when pushed. They knew they didn’t have the underlying authority and would lose in court.
Do some research and see if that state statute is still being enforced because of the Supreme Court rulings.