Minecraft and 0x8009030D Deep Ocean

I have given up after 2 hours of fighting with XBox app for Windows. I was constantly getting the error:

We couldn't sign you into Xbox Live.
Sorry, something went wrong.
Try again in a while. (0x8009030D).

After trying 1000 different solutions I have ended up with downloading Minecraft from

https://www.minecraft.net/en-us/download

With this launcher you can log in to Microsoft account directly from the app – not via XBox app. And it worked.