I am not biased against code officials although I have a problem when they exceed their authority.
My point was that if the engineer said that something was not allowed and the building official tells the contractor that he can ignore the engineer's construction documents because the building official believed what the contractor wanted to do complied with the code, the building official crossed a line. It is assumed that the construction document do not conflict with the code. The code is clear that the building departments job is to enforce that approved construction documents not to create or modify the construction documents. When the building department does that, they are practicing engineering.
California has strong laws giving public officials immunity when performing their job but there are exceptions. A major exemption is when the building department creates a special relationship with say the owner or the contractor, such as telling the contractor that he can ignore the construction documents, the immunity no longer exists.
In California when the Contractor licensing board is disciplining contractors and there is no architect or engineer on the project, they expect the contractor to comply with the code. But when an architect or engineer is involved the licensing board expects the contractor to comply with the construction documents.
Hopefully contractors have a familiarity with the code but the reality is that contractors do not have the training or project specific knowledge to know either what the code requires in many cases or why the engineer required something. If the building official or inspector believes that the engineer asked for something not in the code but not prohibited by the code, he may convey this observation to the engineer leaving it to the engineer to decide whether to modify the construction documents. The building official and inspectors need to stay in their lane.
If the contractor has a question regarding whether field bending is permitted, he should direct that question to the engineer. Yes, if the inspector observes a code non-compliance, he should note it, so that it can be corrected. But it is not the inspector's job to bypass the engineer.