If something goes wrong in dimension use /fm error command, it will return you back to the overworld.