Your laser may be losing connection due to a loose USB connection, a USB port sleeping, static discharge causing the controller to reset, or insufficient power supply leading to a brown out condition.
Check your USB connection, and try a new, shielded USB cable. Route your USB so that it avoids the stepper motors or anything else that could cause electrical interference. Make sure that your machine is properly grounded. Make sure there are no devices on the same circuit as your laser that could be causing a power drop or brown out.
Here are some resources to help you troubleshoot these issues: