Hello! Have you checked your settings for your USB port? It maybe going to sleep along the way and interrupting the communications between your computer and CNC. Note I didn’t say computer going to sleep, just the port. That, in my opinion would be a good place to start. Please let us know your solution once you find it.
Have a look at this post, may explain it better than I can with only one cup of coffee. USB Selective Suspend in Windows 11 - #4 by Condor00
Jake