There is a function by which you can use a mouse on more than one device (if they are both in range and on). It's called Universal Control.
- Turn on Universal Control:
- On your Mac, go to System Settings > Displays > Advanced (if using macOS Ventura or later) or System Preferences > Displays.
- Turn on “Allow your pointer and keyboard to move between any nearby Mac or iPad.”
I once had this problem when I had paired my mouse with my iPad temporarily while my MBP was in for repair. I did not realise until one day when both were on and on my desk. I just unpaired the mouse from my iPad and the problem was fixed.