Try this
Download the previous Xbox and Gaming Services here: (mega dot nz url)/file/aiBwAJpS#KmEbWa-BfU7kMGhrkW2x4dSkX3zlowgxdJNk5WAxPQs (I can’t add links)
Put the files in the root of your HDD (C:\ for example)
Open the Microsoft Store and go to the 3 dots on the upper right and go to Settings and turn off “Update apps automatically”
Uninstall the Xbox app through Settings>Apps> Apps and features
Press the Windows key + X and select Windows Powershell (Admin)
Run the command
Get-AppxPackage Microsoft.GamingServices | Remove-AppxPackage
Restart your PC
After the restart open Powershell as Admin again then run
add-appxpackage -path C:\Microsoft.GamingApp_2021.322.1830.0_neutral___8wekyb3d8bbwe.Msixbundle
and
add-appxpackage -path C:\Microsoft.GamingServices_2.51.3002.0_neutral___8wekyb3d8bbwe.AppxBundle
Check the versions on the Microsoft Store “Downloads and Updates”
DO NOT UPDATE the Xbox app if it ask you to! And stop them if they start when you open “Downloads and Updates”
Also note that even with turning off “Update apps automatically” these apps may update by themselves anyways.
Let me know if works for you