The problem is that the occupant was caught unawares. And, yes, under virtually any circumstance, an occupant should be able to reschedule a safety inspection under this circumstance. The correct attitude of the officer should be a polite apology and eagerness to reschedule at an agreeable time.
Our constitution prohibits unreasonable searches (inspections) including unnannounced searches, or searches that are not specific, yet does allow for reasonable announced and specific searches. The idea is to establish a reasonable notification period, a good delivery system for that notification, and to be specific in what is being "searched" or inspected . . . ie: building code violations, property maintenance code violations.
I have systematically inspected apartment complexes and other type of rental properties in our jurisdiction for property maintenance violations, careful to establish a good notification process, but still caught some folks unawares. In every case, I am happy to reschedule, or, if requested by the owner or occupant, am happy to obtain a warrant if that is their preference.
Those that believe that officials cannot enter a private home are mis-informed. Those that suggest it is simply okay to shoot are mis-informed. I do not know what might become of a person who shoots first, only to discover later a notification was simply ignored.
This country would not be worth a damn to live in without the sensible restrictions placed on search (inspection) and seizure. But, what kind of place would it be to live in if there was no provision for search (inspection) or seizure?