I was hoping they'd mention something about the legality (or lack thereof), but I guess that's an exercise left to the reader who wants to try this out at their own apartment.
For repairing a broken thing? After provably trying in vain to get the landlord to fix it?
And it's definitely possible to get in trouble for "fixing" something if you're not authorized to fix it.
I would call this "bypassing building controls to allow unauthorized access to the building." Frank has access to the building through the allowed means per his lease, not through any means. If his lease is like mine there's a whole page to initial about being granted access through the gates or pool or whatever with only the complex-assigned keys and RFID tags.
(I presume Frank lives in the US, and his state's tenancy laws similar to mine apply.)
Down the hallway from my office used to be the management of a small hotel chain. We often had lunch together and I got to hear a bunch of interesting anecdotes over the years.
Way back when they started up and didn't yet have enough cash to actually own the buildings they operated in, they rented. One of the buildings turned out to have numerous issues (holes in the roof, gaps near exterior walls, etc...). To the point that they eventually didn't pass a fire inspection. They repeatedly asked the owner to have it fixed. Pressed for time, they themselves eventually payed someone, out of their own pocket, so it would at least be up to code for the fire inspection.
From what I was told, the owner threw a tantrum over them modifying the building, terminated the contract and sued them. Successfully.
If you are a tenant in a rental apartment, you'd probably have more leniency on the legal side (compared to a company renting a business property). But still, I'd be very careful making any assumptions about the legal situation rather than risking some sort of Kafkaesque legal mess.
Over here at least, it is very common in apartment complexes that the apartment owner is a different person/entity than the building owner and only the later has the rights to mess with stuff installed in the walls (e.g. plumbing) and especially stuff elsewhere in the building (e.g. an external intercom system). If you ask the landlord to fix it, the best they could do is forward that request to the building owner. If you pulled a stunt like the OP did, there's a good chance that the building owner will sue your landlord.
I don't know if this would apply to a commercial tenant.
But it would definitely not apply to non-violating conditions like the OP's case.
Was the unauthorized modification permanent or undoable? If the latter, I think some people should really get their judge card (or landlord card) revoked.
Did the judge at least suggest what alternative action the tenant should have taken to comply with the law and code?
Whether or not it's worth all the trouble and time is a different matter. For most people, I'd say reporting to relevant authorities to make the landlord's life harder without needing much continuing effort is probably worth doing, but the lawsuit side is likely to be a huge time and money sink and it's almost always easier to just move. Let the city sue them for continuing to accrue complaints of unsafe living conditions.
In the same way, a landlord cannot evict you themself if you just fail to pay rent, but there are multiple legal mechanisms to eventually get the sheriff to do it for them. Basically, if landlord-tenant negotiation fails, I think the only legal recourse is to involve governmental third parties unless you technically open yourself up to legal reprisal.
The last apartment I rented (London) I never even met my shitty landlord hiding all the way up in Scotland. Randomly one day after getting home from a long day at work, my fob wouldn't let me in at the front door. Message the landlord ("SMS only, no calls") and it turns out that he'd got another copy made in case he needed it - when he got this copy made, the security company disabled the current fob (my one).
Initially he was going to make me wait until a new fob could be sorted out. After much anger and aggression I got his fob sent down to me in the post. Was still not able to access my home for several days and had to emergency crash with some friends.
Didn't get a discount on the rent and the fucker came up with every excuse under the sun to take my security deposit upon moving out as well.