When you teleported it shoot you high in the sky in the new world you created. Now it checks what Y coordinate is the first block is at, and teleports you there.
Made it when the world gets removed and you are currently at that world it teleports you back to the first world the plugin sees. Before it kicked you from the server.