Try uninstalling the game bar and then reinstalling. I did it right now it worked.
To uninstall game-
- Open powershell and Run as administrator.
- Type this command
Get-AppxPackage *Xbox* | Remove-AppxPackage
- You can reinstall through microsoft store.
I was able to solve this problem using this method, but it seems that the uninstall command is slightly different.
https://www.elevenforum.com/t/uninstall-or-reinstall-xbox-game-bar-in-windows-11.14456/