I set up a Child Xbox Live account for my son so he could play Minecraft on his iPad.
I also have Minecraft on my iPad, and we have successfully played together many times in a LAN mode using local worlds saved on each other’s iPad.
I signed up for Realm 30-day trial so we could play in a world that is not tied to either iPad (and works from anywhere).
I changed the two settings (create & join clubs and join multiplayer games) to allow him to join the realm as described in this article: https://support.xbox.com/en-US/games/game-titles/minecraft-realms-overview.
After changing those two settings in his account, the Minecraft game would crash on launch every time we attempted to open it.
Rolling back the settings did not fix the crash.
Deleting and re-installing the app (after rolling back settings) fixed the crash, but it his local worlds were lost as a result.
I reproduced the crash a second time changing the same settings.
This time, I figured out I can fix the issue by deleting the XBLStoage.json file, in the Minecraft folder in the Files app on iOS.
After deleting that file, the game launches without crashing. There is an error message about global resources being missing, but the game handles it without any obvious problems.
Related issues
Comments

Thank you for your report!
Crashes and related issues such as these are logged automatically, and will be looked into further by the development team.
If you need help or support you might like to follow a link below.
Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki

Hey this issue is not resolved, I've put two devices in a crash loop now as a result of this issues, I'm going to test deleting the XBLStorage file as suggested, but this is very frustrating.

MCPE-20548 suggests some workarounds for this issue.
I recommend contacting Xbox support https://support.xbox.com/en-us and see if they can find a non-script deleting way to solve this issue for others that are having trouble with this. Also, thank you for reporting a bug! 🙂