The connection loss issue could be a simple USB connection drop out. Here are some resources on troubleshooting connection issues:
xTool provides some suggestions of their own here:
If you find that a simple change, like trying a new USB cable, does not resolve the issue you’re seeing, I recommend looking into xTool’s suggestions from the above guide - some of the possible causes will require contacting xTool support.