The towns/licensing authorities care not if they get sued....as they, as individuals, don't have to pay to defend, or pay damages. T.hat's assuming that a judge finds in favor of Joe Sixgun.
I mean, if you get charged with a violation of a law that you didn't know existed, tough sh!t. You still have to comply. Towns that are breaking laws that they know about, know that they're not doing the lawful thing... But, they're essentially immune. It was a while back, but some towns were charging >$100 for an LTC. GOAL called them out, the state Inspector General said, "You're right....tell them to stop." AFAIK, no one that was overcharged got a refund, and no person or entity faced any sanction.
I know, I'm a wet blanket.