This still didn’t work and I can’t open minecraft
First try hard resetting your computer by turning it off with the power button. Then wait ten seconds before pressing the button again to turn it on. Now:
Try deleting Xbox app, then reinstalling. After this sign back in to Xbox with your Microsoft account. Try reinstalling the gaming services by opening windows powershell as admin in the search bar and running this command;
get-appxpackage Microsoft.GamingServices | remove AppxPackage -allusers
Run this and then in the same window run the following command;
start ms-windows-store://pdp/?productid=9MWPM2CQNLHN
Install the app on this page and accept the pop up message by pressing ‘yes’.
Then restart your device and uninstall, then reinstall minecraft launcher, then attempt to launch.
Hope this works for you as well as it did for me.