Hi ,
In this case, you have to access your Microsoft account, go to privacy and see if the options below are active.
Manage multiplayer settings using Xbox Privacy online
- Visit Privacy & online safety on the Xbox Settings page.
- Sign in using the parent’s Microsoft account.
- Click on the tile for the Microsoft account you want to manage.
- Select Privacy or Xbox Series X|S, Xbox One, and Windows 10 devices Online Safety to locate specific settings.
- Adjust settings as desired.
- Click Submit and wait for the page to reload.
Sign out of Minecraft and restart for the new settings to take effect.
Give feedback if the information was useful or not.
Thanks