When I was still an apprentice without extensive code knowledge, they let me help design the power distribution for a 12,000 square foot house with five subpanels, and I put 3 of the panels in walls behind doors in closets. It makes sense because even at an early stage of the design process, you know that space is going to be clear. It's a wall behind a door. What else could they use it for? Only later I learned that you're no longer allowed to put a panel in a clothes closet. Oops. My employer should have known, at least. I was just an apprentice and I was used to seeing panels in clothes closets because we worked on a lot of older houses. The house was out of city limits so it didn't require inspection. Otherwise we would have had to relocate 2 or 3 subpanels.