For me it only occurred when being connected to a specific network, directly or via VPN.
Here's what resolved it:
The registry key
"My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\InFileMapping\win.ini\Windows\SnapToDefaultButton"
was set to: "#USR:Control Panel\Mouse", which should have picked up the 0 from
"My Computer\HKEY_CURRENT_USER\Control Panel\Mouse\SnaptToDefaultButton", but didn't.
So I replaced "#USR:Control Panel\Mouse" with 0.