In Portal 2, the Final Boss defies Boss-Arena Idiocy by finding out the recordings of how you defeated the previous boss and intentionally location up the arena to stay clear of all those similar errors.
Unfortunately for Wheatley, he failed to defy the ultimate trope: Chell opening a portal correct under him, with the other side on the surface area of the moon.