Not quite right...the zoning departments do have the ability to enforce zoning compliance.
I never said they didn’t have the ability to enforce zoning compliance which is totally different than complying with a building code. I was addressing the NEC - and not compliance with ZONING ORDINANCES which are different than building codes.
If you put up a building in conflict with a zoning ordinance, such as a commercial building in an area zoned residential - then, in all probability, the building department will make you remove the structure as it does not meet the zoning requirement for that area.
You seem to be conflating a zoning issue with a code violation - not the same thing.
However, you are correct, in that the AHJ can make the contractor either fix or completely remove and replace work that is not building code compliant.
How the work is corrected is at the discretion of the AHJ. If it’s simply redoing connections in five junction boxes - that’s one level of correction. If the AHJ directs the contractor to remove and replace all of the wire for all of the circuits because it’s the wrong type or size - that’s a different level of correction.
The statement was made that the NEC is a Federal Law - it is not. That’s all I was addressing in my post.
You somehow conflated that with zoning - a completely different building issue and it’s hard to see how a builder or client would get plans approved and permits issued by a building department if they did not meet the correct zoning requirements.