Hi Brør. I'm Greg, an installation specialist, 10 year Windows MVP, and Volunteer Moderator. If you will work with me I will be here to help until the issue is resolved.
If this is repeatedly happening then there are known fixes for Game bar here to also try to see if it's more pemanent:
See latest fixes working for Game Bar here:
https://support.microsoft.com/en-us/help/402858...
https://www.askvg.com/fix-game-bar-is-not-openi...
https://www.thewindowsclub.com/cant-record-righ...
If that doesn't help then Reset Game Bar in Settings > Apps > Apps & Features > Xbox Game bar > Advanced Options.
If that doesn't help then re-register Xbox Game bar from Option 2 here: http://www.tenforums.com/tutorials/3175-apps-re...
And if that doesn't help then uninstall Game Bar in App Settings above, restart PC, reinstall Game Bar from Microsoft Store Settings > My Library.
I hope this helps. Feel free to ask back any questions and keep me posted. If you will wait to choose if I solved your problem, I will keep working with you until it's resolved.
________________________________________________________
Standard Disclaimer: There are links to non-Microsoft websites. The pages appear to be providing accurate, safe information. Watch out for ads on the sites that may advertise products frequently classified as a PUP (Potentially Unwanted Products). Thoroughly research any product advertised on the sites before you decide to download and install it.