I just found a solution that worked for me on my 2018 Mini. I've been having a progressive issue with a WD 2TB SSD in a OWC Elite Pro Mini enclosure dismounting abruptly for probably over a year. In the last month, the drive wouldn't stay mounted for more than a couple minutes. The problem tracked with what I've read here. I tried swapping cables and enclosures. Neither worked (though as you'll see it was not a failing cable, but rather some sort of problem with communication over whole classes of cables). Yesterday, worried that the drive was failing, I ordered a new 2TB hard drive. I connected both to start transferring data over. The new drive started having the same dismount problem. I couldn't transfer more than 100gb. I tried running them off of an Anker dock. Still had the issue.
My solution: I tried my USB-A ports and the drive mounting completely stabilized. Then I realized I was using an Anker cable, and maybe it was the cable. I tried a USB-C 2.0 Anker cable through my Thunderbolt port. The drives were stable with that, too. I then tried an Apple Thunderbolt cable. Stable, plus return of 10gb/s transfer speeds. Cables that didn't work: a thunderbolt cable from 3rd party on Amazon, the USB-C 3.1 cable that came with my ProGrade SD card reader, and the USB-C 3.1 cable from OWC that came with my Elite Pro Mini enclosure. I recommend either using a high quality Thunderbolt cable, or a high quality USB 2.0 cable (if maintaining connection is more important than transfer speeds). Hope this helps someone!