I have also had this issue on Java edition. The screen will sit on "connecting to the realm..." indefinitely. Contacted minecraft help and followed all of their suggestions. Logged out and back in, checked, restarted and reset my network. Checked the firewall. Couldn't identify the problem. Nothing obvious has changed on my end and I was spending heaps of time on the realm, so I don't know why the issue all of a sudden.
I have also had this issue on Java edition. The screen will sit on "connecting to the realm..." indefinitely. Contacted minecraft help and followed all of their suggestions. Logged out and back in, checked, restarted and reset my network. Checked the firewall. Couldn't identify the problem. Nothing obvious has changed on my end and I was spending heaps of time on the realm, so I don't know why the issue all of a sudden.