Here's a video of the Final Doom Teleport Bug in action, in MAP23 of Doom 2. Notice how the player teleports in at the correct Z for a split second before the engine sets the incorrect Z. Doom then realizes the player is stuck in the ground, and recalculates Z.