That happened to me in Broward County shortly after Hurricane Wilma.
It was, granted, about a week later, but I had repaired my fence, using the existing poles (4 feet apart) and the town changed its building codes DURING the Hurricane to mandate that the poles be 3 feet apart.
I got fined, and had to rebuild the fence from scratch.
It’s al about the money. Makes you wonder if the enforcers are getting a kickback.
Personally to me if you use existing poles it is a repair job and the new work grandfathered in under the old code. The exception would be if there was a safety hazard because of the poles being set 4 ft apart. Which I can’t imagine.