Mouse moves vertically on login
The most likely answer is that something is installed or loaded at the user level that allows the mouse to function properly.

Can you try creating a fresh user and logging in as them and see if you get the same fixed result once you're logged in?

Alternately can you try another 3rd party external USB mouse to see if it experiences the same issue.