Hi!
I’ve got some trouble with my mouse wheel (mouse reference is Logitech M510).
While clicking on it to activate the Orbit tool and moving around, sometimes it undoes the last action. I haven’t found anything on this topic so far.
Perhaps you also sometimes click by mistake on the side buttons of your mouse that are mapped to undo ? having to click on the middle button makes us push the thumb unconsciously
Try them intentionally to see their effect,
also, check in the logitech software what are all the buttons mapped to
It might be mapped to backspace, and if by any chance you also hit the alt key on your keyboard, it would undo, explaining the “sometimes”