The problem is most judges do not follow either the law or our Constitution. They are tyrants.
I know plenty of cities have tried to impose gun ordinances but none have withstood a challenge. Most recent that I can remember is near Detroit where they wanted to ban guns at a “private” street festival. That died before ever seeing a courtroom for obvious reasons.