This is not something we have encountered in our labs. Testing on the fly we can confirm that on Ubuntu 22.10, everything works out of the box with default manufacturer settings, so we have not idea what you could be doing wrong.
What you didn’t mention is what desktop environment you have on these hosts, what display server is it (Wayland or Xorg?) and the typical steps to reproduce this problem. For example, you say that it happens when the connection has been interrupted for some reason or another: what is the reason for the “interruption”?
What errors, if any, does NoMachine show when you try to reconnect after this interruption?
Logs of the server side would also be useful so we can check what is happening. Follow the instructions in the document here and then send them to forum[at]nomachine[dot]com
https://kb.nomachine.com/DT11R00182. Make sure you enable debug first, reproduce the problem and then extract the logs.
Thank you.