There are ways around that too. Cities pass laws saying you have to have a license to do a certain job. Then the licensing board becomes union thugs. They decide who gets a license and who doesn’t.
I agree that cities and states have many ways to restrain trade and competition. Politicians are easily moved with campaign contributions and single issue interest groups. The list is so long: autos, health insurance, movers, taxis, bond underwriting, ...