Sometimes, Windows 11 installs a generic "HID-compliant game controller" driver instead of the specific Xbox driver. When this happens, the controller works on the desktop (moving the mouse) but fails in games.
Windows 11 aggressively pushes drivers through Windows Update. Usually, this is good. Occasionally, it causes issues.
Open > Bluetooth & devices and ensure Bluetooth is On . Select Add device > Bluetooth .