Hi,
It seems a lot of people have the same problem with Windows XP VMs in Windows 11. See if the solution in the thread below is right for you.
[Updated solution] mouse/pointer random inversion/flip or - Microsoft Community
You can also use Remote Desktop Connection (mstsc.exe) to connect to the virtual machine to see if the same problem still exists. If yes, try uninstalling the mouse in the virtual machine's Device Manager and then resetting the virtual machine in Hyper-V Manager.