Code used to say 'no panels in bathrooms,' and went on to define a bathroom as a room with a sink and a toilet, etc. Seems a pretty precise definition, and under it the situation the OP describes would be allowed.
The 'fly in the ointment' is the so-called "Euro-style" bathroom, where the sink and shower are in one room, and the toilet is in a completely separate room nearby, and both rooms open into the main room or main hall. There's also the 'hotel' arrangement where shower might be to one side, the toilet to the other, and the area between having the sinks, yet being open to the bedroom part of the room.
So, 2011 slipped in the word "area,' and now all bets are off. "Area" can mean anything you want it to mean. Heck, I'm gutting my place, and the rewire I plan has the panel on the hall face of the common wall between the bathroom from the hall. Indeed, the panel will sit right next to the shower plumbing, inside the 'shower wall.' Will someone argue that the space inside the shower wall is part of the 'bathroom area?' Stranger things have happened.
This is, alas, what happens when the code tries to make design decisions. It's almost as if archetects deliberately try to confound the code with their creations. The code would be an easy thing to wrote if only everyone lived in the same style house .... but that's not ever going to happen. Never has, never will.
So, where does the answer lie? It lays right at the very beginning of the NEC - which, oddly enough, quite plainly states that the code is in no way a replacement for the AHJ, and the AHJ trumps anything the wizards of Massachusetts may publish. For far too long AHJ's have been playing the dishonest game of telling folks 'it's not my fault, I have to follow the code,' as well as the lazy route of actively campaigning every cycle for the code to take more of the responsibility off their shoulders.
Holt's NEC update book has an illustration of the exact situation described by thr OP, and addresses the 'area' idea rather well. Still, it comes down to defining the extent of the 'area,' and architectural elements help define the 'area.' Such elements may be as substantial as a door or as subtle as a change in the flooring or lighting. By giving the AHJ such a free hand, they've also placed the burden squarely on the AHJ to make the call. AHJ's, by their very nature, are going to paint with as broad a brush as they can.