Would you try this:
1. Run a remote shell and connect to the macOS system
2. Use sudo to gain admin rights: sudo -i
3. Run these commands to unload NoMachine agents:
launchctl unload -wF /Library/LaunchDaemons/com.nomachine.server.plist
launchctl unload -wF -S LoginWindow /Library/LaunchAgents/com.nomachine.localnxserver.plist
4. Run these commands to reload:
launchctl load -wF /Library/LaunchDaemons/com.nomachine.server.plist
launchctl load -wF -S LoginWindow /Library/LaunchAgents/com.nomachine.localnxserver.plist
5. Restart nxserver:
/etc/NX/nxserver --restart