You are correct about ordinances being written by a city or town. But I think somebody’s playing a joke on you if they told you that there is a such thing as a “not binding or a non-binding law.” Your town’s speed limit is an “ordinance” and if you violate it, you will be “bound” to a legal penalty.
It’s possible you’re thinking of an “unconstitutional law”. BUT, I think all laws, that are enacted by a constitutional legislative body, regardless of it being federal, state, city, or town, are automatically considered to be constitutional and will be enforced by the executive branch and be judged accordingly by the judicial branch. . A Supreme Court could overturn a law based on constitutional matter. BUT, that’s not likely to happen until a person is arrested, tried, and convicted, (and most likely sitting in prison), which would give him “cause” to challenge that ordinance, and then, sometime down the road, if he has lots of money or a constitutional rights organization deems it a worthwhile battle to fight, that person may or may not be absolved, based purely on the fact of who was the best debater, but keeping in mind that a prosecutor has bottomless pockets of money, and he will appeal the ruling if it was not in his favor. I would also add, from what I see of what’s happening in our country, that if the person is a registered ex-sex offender, his chance of a win doesn’t seem likely.