This problem just happened to my laptop 2-3 days ago.
And I believe it is not a hardware problem (at least for me).
It is like your mouse would suddenly lose focus to all windows (sometimes it still works on the window you are focusing, but cannot do anything outside of that window), using my touchpad has the same results.
I tried rebooting, updating logitech driver, updating windows update, tried switching usb ports, none worked.
Ctrl Alt Delete can bring back control for a couple of minutes, until it randomly happens again.
Also windows 11, can't believe after 3 years this problem is still not solved...