To further @unknown's comment, logging out and back in while stuck in the portal loop has a chance of spawning you in either the overworld or nether at the coordinates of the portal in the other world.
This includes possibly ending up on top of the ceiling of the nether.
To further @unknown's comment, logging out and back in while stuck in the portal loop has a chance of spawning you in either the overworld or nether at the coordinates of the portal in the other world.
This includes possibly ending up on top of the ceiling of the nether.