There is no doubt appliances located in closets, attic spaces, & attics make it extremely difficult for compliance with the NEC requirement for working & dedicated equipment space.
That being said, the installer has several options to come into compliance. If space is not provided for an actual disconnecting means, the a "unit swtich" can be installed. If there are no provisions for a "unit switch", a breaker lock-out device can be installed.
I will admit I have approved disconnecting means located with one or more working space dimensions NOT in full compliance, but where I was readily & easily able to approach, examine, operate, and inspect the equipment without resorting to acrobatics or other unsafe practices.
But those are exceptions to the rule, not the rule...
_________________________
Bryan P. Holland, MCP