Like any computer hardware, however, a mouse can act up ... No software change will fix a problem with your physical machine.
The optional KB5050094 patch for Windows 11 was supposed to fix stuff, but introduced problems of its own with the mouse ...
But you can often fix a mouse ... on your PC to see if that helps. Here are the steps: Follow the on-screen prompts to finish updating the driver and check if that solves the problem.