I have been having this problem for actual months now. I have done everything just short of starting a new account. This is on PS so I can't use the Xbox settings
How to Add Friends in Minecraft and Play With Them
Can't use Realms on Xbox?! How do I fix my account settings? : r/Minecraft
How to fix privacy and online safety setting in Minecraft PE - YouTube