An inspector is not the AHJ (unless local statutes empower them to be, which is not likely, and the reason for that is for consistency). The real AHJ is the community development department (or similar building department) which enforces local code. Creation or adoption of code is a function of the legislature, which is actually above the level of the AHJ. This is all very similar to the rest of our legal system.
Contrary to what Roger said, a police officer can give you a citation for driving 55 in a 55 zone, if for no other reason than he is having a bad day. Similarly, an inspector can issue a citation (fail inspection) on what ever whim he wants. They can do this so long as people are willing to roll-over and plead guilty without a fight. In the case of the cop, it is paying the ticket by mail. In the case of the inspector, it is rework.
To those that don't wish to roll over, the procedure is similar. With citation in-hand, the citizen has to go see a judge (or AHJ) to determine guilt or innocence. The judge (or AHJ) is responsible to determine if the applicable codes and statutes have been followed or not.
The judge, just like the AHJ, determines whether local ordinances have been upheld. They cannot change the laws or statutes that have been written, but they do have the authority to interpret them if there is room for interpretation. This is something that neither the cop, nor the inspector have the authority to do, and that is to make absolute interpretations of statutes--that is the job of the AHJ. The cop or inspector can speculate, and issue a citation on that speculation, but only the judge or AHJ has authority to make interpretations.
Deciding whether to adopt the NEC and/or make amendments is the responsibility of legislation. It cannot become a statute or ordinance unless it goes through the legislation. Even the NEC is completely worthless unless the local legislation decides to adopt it--at which time, the NEC becomes "Law" for that jurisdiction--with or without modification. (Some people claim that the NEC is a "guideline", but once it is adopted by a jurisdiction, it actually becomes the Law for that jurisdiction.)
One last point, both cops and inspectors can be guilty of abuse of power, and both are not immune to being removed from office for this very reason. A friend of mine had a state inspector removed from duty when the inspector thought he was dealing with a DIY homeowner and stepped grossly and abusively over the line, but it turned out that the homeowner that he intimidated was the mother of a commercial electrician that actually did the work.