the arrow on the lock was pointing to the right on the computer and points to the left on my A4000 desktop.
On the A4000T the switch points 'right' for normal operation. But it doesn't sound as though this is related to the problem. If it was related, you'd also find the keyboard wasn't working.
As already mentioned, check the 2 x 40-way IDC cables between the main board and ports module. I had similar issues with mine recently with intermittent mouse movement. I thought it was dodgy cables, but new ones had the same issue. When the ports module and cables were moved the problem went away. Doesn't appear to be solder joint issues, I gave up looking after the problem had fixed itself. I spend enough time repairing customers' Amigas without having to fix my own.
Check you have 5V on pin 7 of the mouse port. On the A4000T this supply is protected by polyswitch fuse F160 on the main board, so you can check that you correctly have 5V on both sides of that. Though this also supplies power to the keyboard. If the mouse/joystick port 5V output gets a short circuit to ground, I've seen cases where an internal 5V_USER track between CN550 pin 4 and FB556 can go open circuit on the A4000T. Which is a bit of bad design on C='s behalf, polyswitch fuses have a very slow activation time and high fault current can flow for up to a second before the fuse opens.
I've written a few notes on diagnosing issues with the A4000D mouse port
here, the A4000T circuit is practically the same with the exception that the signals route through the ports module.
Not sure why the subject of bad CIAs always seem to arise on the subject of mouse movement issues, these have nothing to do with reading mouse quadrature data in any Amiga model. Worst case, you might have a faulty shift register U541 on the A4000T main board.
Edit: Just remembered
this old thread where I'd discussed the same issues. Wow, I noticed I had a "not the CIA" rant there too, I'm obviously becoming cynical.