If G-SYNC is enabled on your secondary monitor, try turning it off through the monitor’s OSD settings.
Do not disable it through the NVIDIA Control Panel. Disable G-SYNC directly in the monitor’s OSD menu.
In my case, turning off G-SYNC on the secondary monitor through its OSD completely fixed the mouse stuttering in Unreal Engine 5.8, while keeping G-SYNC enabled on my primary monitor.