Thanks for the reply. We tested with a few computers, and found this behavior only happens with NoMachine on RHEL/Rocky 9. Other computers with RHEL 8.3/8.6 work fine with NoMachine.
This behavior is highly related to NoMachine: The python applications forward their GUI through the ssh client without problem with NO NoMachine installed. But the GUI stops being forwarded right after NoMachine is installed and started. After I completely stopped nxserver, the GUI will be forwarded again. I’ll have to completely shutdown the nxserver then reboot the computer to resume the forwarding.
The NoMachine we are using is Workstation version 8.13.1
Edit: typo