Run SFC and DISM commands to scan and repair system files that may have become corrupted.
Open the Start Menu and type cmd, right-click on Command Prompt and select Run as administrator.
Copy and paste the command;
sfc /scannow
Press Enter and wait for the process to complete.
Then copy and paste;
DISM /Online /Cleanup-Image /RestoreHealth
Restart the computer.
If you have Gamebar enabled, try temporarily disabling it.
Click on the Start menu and open Settings
Go to System > System Components
Search for Game Bar and click on the 3 dots (...) > Advanced options
Click the "Background component permissions" menu > Select "Never"