The issue also occurs when players tinker with the settings of the game and it is likely that this is the reason behind your problem as well. If even deleting the mods and resource packs couldn’t help you start playing in realms again, you should switch to the default settings. If that still doesn’t work, you can try deleting all your mods and resource packs, or take a quick look at the fixes below instead. If you don’t know which specific resource pack or mod is causing the problem, you should uninstall all those that you installed after the problem became frequent.
If this issue started to occur after you installed a specific mod or a resource pack, it is highly recommended that you get rid of it by uninstalling it. There are some resource packs and mods that mess with the game and will not allow you to play in a realm. This problem frequently occurs when players try to access a Minecraft realm while using resource packs or mods. You can enquire their support about the issue if there is a server issue and they should be able to fix it in time for you to enjoy playing in Minecraft realms after an hour or few. If you don’t prefer to wait for it, there is an option to contact Mojang as well. If the problem is indeed with the servers, all you can do for the time being is wait for Mojang to fix it.