I've got the exact same problem @preisen or @jamesjnadeau explained below.
My son cannot play anymore with his friends or even me.
Everything was fine the day before.
I got an email from the support than sent me here, with no solution excepte internet issue or restart the game... Of course it does not fix anything as the Switch is OK with all others games and Internet "things".
COME ON MICRO$OFT!
P.S: the pinned solution is for Windows ONLY. It's obviously not working for consoles (Switch & PS)
I'll reply to myself.
I finally "fixed" this issue by changing the way I sign in to Microsoft services.
It used to be with a temporary code sent to my email address, by default.
Changing this method to a password authentication one allowed me to login to my Microsoft account in Minecraft (Nintendo Switch).
I can't believe it, but it's real. How can this king of company can have such a miserable infrastructure and products?