“a locking device that trapped someone in the office would seem to be a clear violation of even a half-assed building code”
Well, if you were modifying your office to be your own private sexual assault lair, you probably wouldn’t be too concerned with complying with the building codes.
Whomever helped him out with it is on some deep doodoo. We know he’s not smart enough to do that himself.