I had to remove my Microsoft account from my local Windows account and add it again, I ran wsreset.exe to reset Microsoft Store, used Powershell commands to remove Minecraft and all the XBOX stuff and then I reinstalled it. Then, I signed into the XBOX app, installed the launcher and everything worked fine. It seems that something was wrong with logging into my Microsoft account and doing this fixed it.
I had to remove my Microsoft account from my local Windows account and add it again, I ran wsreset.exe to reset Microsoft Store, used Powershell commands to remove Minecraft and all the XBOX stuff and then I reinstalled it. Then, I signed into the XBOX app, installed the launcher and everything worked fine. It seems that something was wrong with logging into my Microsoft account and doing this fixed it.