In my experience, being "outside the corridor" is not a phrase which would be used in spoken English (at least not in the sense of 'corridor' being used here), given that a corridor is not usually considered as a room in its own right.
However, in this specific instance, I believe that the characters have been told explicitly not to enter the third-floor corridor and it's this establishment of it as a location which makes the phrasing more palatable.
I would imagine "outside the third-floor corridor" to refer to an alcove at the top of the staircase from which the corridor is visible, but is distinctly not part of the corridor.
It's an odd and rare usage though, which you'd be unlikely to hear or see elsewhere. Even the mentions here don't seem to refer to 'corridor' in its physical sense.