It is entirely possible for buildings to have been constructed that don't meet the building code. It happens all the time. Inspectors are people, and people miss things. They can also be bribed to look the other way when the code is not met. In the '94 Northridge quake, one apartment building that collapsed, killing 16 people, was discovered to not have been built to code. I know that the contractor complicit in that was sent to prison. I hope he's still there, if he isn't dead yet. The Uniform Building Code was updated after that earthquake to provide requirements for more seismic bracing. I have no idea if bribed inspectors were complicit in your building losses, or the apartment in Northridge.
If you get to thinking you’re a person of some influence, try ordering somebody else’s dog around.