2A is Federal Law, so local government can't restrict it. If you think local government has been violating it for years, then it doesn't mean what you think it means, according to the current very-right-wing Supreme Court, which has recently struck down unconstitutional gun laws.
The Supreme Court doesn't just go through the books of places and strike-through laws they don't agree with. The law has to be used against someone and it has to be appealed through multiple levels and then the Supreme Court has to be petitioned to review it. It takes a lot of money and time, and many people are just going to settle in the lower courts.
Places have had unconstitutional laws on the books for a long time before someone had a case that made it to the Supreme Court. For every case that you do hear about, there are cases that don't make it for whatever reason and you don't hear about.
I am definitely not a legal scholar, so if any facts in my comment are wrong please let me know.
I believe you are correct and you have identified part of what is broken or frequently abused in our political system. Unfortunately there are only two parties and they seem to focus on all the things that piss off the other guys so much that they are each more than willing to advocate for and attempt to pass new laws that clearly are unconstitutional knowing that if they can maintain control of enough of the process that those laws can be in force for a long time and may bolster their position over that term.
Citizens need to be more informed about the whole legislative process, their rights and their responsibilities etc. Voting should be mandatory and more than two parties should be in the process. Somehow we have to make this work or we are all pawns.
Local government isn't supposed to be able to restrict it. But in practice, it often takes a really long time before unconstitutional laws get declared as such by a court.