If a world in your Realm is misbehaving, cannot be opened/closed, or seems broken in any way, try these steps to get back into your world:
- Make sure you have a backup of your world data. See How Mojang Saves Backups for Your Minecraft Realm.
- Move the world you're having trouble with to a different world slot. See How to Upload Worlds onto a Minecraft Realm.
- Select the world slot and click Edit World for that slot and click Reset World. This should fix the slot and allow you to upload your world backup.