Did you check the mouse sensor itself (for any dust/hair blocking the optical sensor, or blocking the rollers if you still have a ball mouse)?
Another culprit might be a “palm rejection” feature of your mouse drivers that would sometimes prevent the cursor from moving within a second or two of you typing, but this doesn’t really sound like that situation, since you made it sound like you tried to troubleshoot it for a few minutes. It usually only applies to the built-in touchpads and not external mice anyway.
To be clear, the problem was gone after you restarted, right, and hasn’t come back since? Shrug. Just computers being computers. Hit it harder next time.
Good prank, but though I don’t want to toot my own horn, it wouldn’t have worked with me. The first thing I do when my mouse acts up is to turn it over and check the sensor for something blocking it. It happens almost automatically.
A single hair from my cat, stuck in the sensor hole, is enough to cause the mouse to stop or become jittery. It’s fixed relative to the lens, so it appears to the sensor that nothing is moving.
Biggest problem I’ve had is the scroll wheel “jumping”. Go to roll down and it may jump upwards a bit and then scroll downward - bouncing and jerky. (optical mice)
After the second mouse started doing this, I googled. It was dust in the mechanism. I tried the canned air and it didn’t fully fix the problem. So I did what the post I read recommended - put my lips around the entire scroll wheen (top of mouse) to seal and blow hard into the opening around it. This has (so far) fixed the problem.
Any type of mechanical problem, dust or other foreign material in the mechanism, blocked sensors, etc. are not likely to have been fixed by a reboot as the OP describes. I would say it was most likely a driver problem, either a bug in the driver or OS, or corrupted memory. The latter could be caused by a hardware failure in the memory, or an OS bug totally unrelated to the mouse which just happened to corrupt some memory used by the mouse driver. There’s not much that can be done to diagnose it unless it recurs. You could run a memory diagnostic just to be safe.