I've been having this problem ever since the new menu UI change to Minecraft, which has been a couple months. Whenever I open the friends/realms menu my game lags to the point I can't do anything and sometimes just crashes. I attached a mouse to my Xbox, and was able to drag the cursor a little bit every few minutes. Even when I can reach the realm button after awhile it just gives me a error code, but I'm not sure if the two problems are related. I think this problem may only be occurring to people with a large friend/realm list. I haven't been able to play with my friends for months.
This issue is being tracked at MCPE-180677.