I nearly bought new hardware to fix a settings problem.
Microsoft has fixed a known issue that wiped mouse settings on some Windows 11 systems after installing the KB5120998 August ...
Are the mouse and keyboard not working in Windows 11? Try disabling fast startup, scan for malware, update driver, amongst other fixes.