At the end of Portal 2, There’s a cut scene which shows your ascent to the surface and to safety. However, this scene doesn’t seem to line up with the rest of Portal or Portal 2. At the end of Portal (1), After defeating GLaDOS, you are pulled upward into blinding sunlight and find yourself outside. This seems to show that the surface is right above GLaDOS’s chamber. This is reinforced in Portal 2 when defeating Wheatly. After being hit by the bombs Wheatly uses to sabotage the Stalemate resolution button, you are lying on your back when some wall panels fly off revealing the moon.
This would also seem to suggest that the surface is not far from the chamber. How can you take the long elevator ride at the end of Portal 2 when the surface is right above GLaDOS’s chamber?
I’d say it’s a case of moving architecture. We see in Portal 2 how entire rooms can be shuffled around the underground without much of a hassle. When GLaDOS started cleaning the place up she probably decided it’d be safer in some way to have her room not directly under the surface. Wheatley probably put it back when he was in control because he’s a genius that way; it was then moved back down afterwards.