Hey Lucas!
Nice to meet you! I'm Darhyl, an Independent Advisor. I'm sorry you are experiencing this with your Minecraft Java multiplayer error.
IMPORTANT: The solution to this issue may take a lot of steps. I will be providing the detailed workarounds to avoid any confusion.
Based on your description, kindly manage your account's privacy settings according to the official Xbox website: https://support.xbox.com/en-US/help/family-onli...
"Sign in to your adult Microsoft account at Xbox.com.
Select your adult account's gamertag, and then select the More actions button (…).
Select Xbox settings, and then select Privacy & online safety. Because you’re accessing sensitive info, you might have to enter your password or PIN.
Select the gamertag for your child account (Main account) that you want to manage.
Select the Xbox Series X|S, Xbox One, and Windows 10 devices Online Safety tab or the Privacy tab.
Review your current settings and update options as "BLOCKED":
> You can play with people outside of Xbox Live.
> You can create and join clubs
> You can join Multiplayer matches
> You can add friends.
Then select Submit to save your changes.
Note: You must select Submit at the bottom of the page before leaving or switching to another tab. If you don't submit the changes before you move to the other tab, your changes won't be saved."
Then sign in again and repeat the same step, but this time, review your current settings and update options as "ALLOW":
Submit to save your changes.
Wait up to 24 hours to make sure the changes will be applied.
Then, please check if you can play multiplayer on Minecraft Java Edition.
Thank you for your kindness and understanding! Please let me know if you need anything else.
Best regards,
Darhyl