I think those local ordinances prohibiting firearm discharges often have an exception for personal defense. Petition them to change it if they "forgot" it.
If it's a misdemeanor, I wouldn't worry about it much. But I'd still try to get it changed--there is no logical basis not to make the exception.
As far as a Catch 22, I think no one would ever prohibit you from defending your home/family because of the poorly written ordinance. If everything is as you say it is, it's obvious the city goofed.
P.S. BTW, does your castle doctrine law provide for immunity from prosecution for using deadly force within the limitations of the statute?