how do you connect the 2 devices, by cabel or wifi?
Cabel would probably be the best.
With wifi you could try to use WIN10 hotspot feature to connect the Win11 device directly to your Win10 wifi what would eliminate the router/access point so the signal has to travel one device less.
spacedesk mouse can always be stuck due to network dropouts (better network connection -> less dropouts).
In addition to this, there are situations when after being stuck first, the remoted mouse is still trailing.
The reason: spacedesk mouse remoting network protocol is still lacking flow control.
Fix is not expected any time soon (development is currently busy with higher prioritized issues and topics).
Thus the only quick fix: Improve network performance and eliminate router. Routers always cause lags and hangs. Performance always improves when routers are circiumvented (either by connecting through WiFi-Hotspot or direct cable connection).