Lost communication

If it’s a problem with the G-code, Carbide Motion or Grbl should issue an error.

You can test for EMI by running an “air cut” with the spindle off, no stock, and no dust collection — if that completes, then it’s probably EMI, for which the solution is usually addressing grounding/static:

Another possibility is a loose/bad USB connection getting vibrated so as to cause the problem, but usually that can be addressed by coiling the cable at each end and putting some weight on it so the tension of the coil pushing the connector into the port.

It might be a failing board, but that’s pretty rare.