This is a long, sad story that might have a happy ending.
About 8 or 9 months ago I got a new MacBook Pro 13-inch, 2016, Four Thunderbolt 3 (USB-C) Ports running OS Sierra. I had three very old external disks connected through a large hub for USB, Thunderbolt, Firewire, etc. Not too long after I started using the Mac, I began to get disk not ejected properly messages.
I would remount the disk(s) and run Disk Utility to see if there was any disk damages. Usually there were not. If there was I would use Disk Utility to repair the disk.
But eventually I kept getting the messages more frequently. And one of the disks (Time Machine) would not remount. I brought it to a tech repair shop which reported there were quite a few unreadable sectors. They could not restore the disk, but if I wanted they could try to copy one or two items. I gave up on the disk.
Based on comments here and elsewhere, I bought two Blackbox Pro dedicated USB-C external drives which were plugged directed into the MacBook. No hubs!
The error messages started soon after and increased in frequency. I had set every one of the energy saver prefs as recommended here.
I also got a utility called Amphetamine (used to be Caffeine) which forces disks to never sleep. I also got Jettison to ensure that the disks are ejected and mounted correctly.
Glyph Technologies said the only time they have seen this type of problem is if the data is corrupted. There has been at least three others with the same issues. Glyph told me that Disk Utility would not help and that I should buy Disk Warrior. I ran Disk Warrior on the volumes of the disks. It reported some problems. I ran DW repairs. It reported the problems were fixed.
I also bought new USB-C cords which plug in with a slight click that the other cords did not do. I also noticed that one of the USB-C ports feels slightly loose. It could be that the plug wobbles enough that the Mac thinks it has been disconnected.
So having done all of the above, it's been about 6 weeks since I ran DW. And I haven't had a ejected-error message.
The problem could (she lowers her voice to a whisper) be fixed. Could. But I don't want to remove any of the utilities or cords or change anything to find out what might have been causing the problem.
I just want my disks to backup and hold old files.
Oh, one more thing. I now have a cloud-based backup service for one of my disks although it can't backup Time Machine.