As a general rule, that problem boils down to USB communication dropouts. The usual cure involves getting a known-good cable from a reputable supplier (i.e. not a vowel-deficient Amazon seller also carrying beachware and pet feeders) with ferrite cores on both ends. IMO the cores add enough cost to justify a little extra QC on the assembly line.
A lengthy discussion covers other fixes you can try:
My Cherokee Beast - #149 by rcline
If a new cable doesn’t change the outcome, there are other problems of increasing complexity.