I don’t understand building codes. It’s not safe for people to sleep there, but it’s safe to work there for eight to twelve hours a day? Something is off.
Presumably because you're awake while working and can notice problems when they happen. Not so much when you're sleeping.
I mean… yes? I don't see what's so confusing. In an office building, if anything goes wrong, an alarm goes off and everyone leaves, and insurance pays for damages. In a residential building, you have people sleeping, sick, possessions they might not be willing to leave behind, babies, pets… It makes sense for the safety requirements to be different.
Are you regularly alone and unconscious when at work?