WD external USB disks intermittently showing
I am thinking this is an OS problem.

There's no evidence of this.  But if you want to be sure you can do either/both of two things:

Boot into Safe Mode where it's a clean version of macOS - no 3rd party apps or kexts (drivers)

Try on a different computer


Intermittent issues are usually hardware related:

Physically a bad port.  For instance, there may be dry solder joints connecting the USB port to the PCB.

Failing USB controller

Failing external drive enclosure


The best way to test this would be to take it to another computer.  If the problems exist there, then the issue is with the external drive, not your iMac.

No evidence of disks failing. Disk Utility finds no problems.

Your disks may be fine, but there are two major components to an external USB drive:

The disk drive itself (already tested as good)
The USB-SATA bridge (controller chip)

If the chip (or any of the electronics on the adapter) are failing or have failed, you will get errors like what you're seeing.  To verify this, you need to remove the enclosure from the equation.  If you can open them up, use an inexpensive USB to SATA adapter to verify.
Use this method to narrow down what the cause can be.  I'm hoping it just the enclosure which is most likely to fail.  The worse case scenario is the USB port(s) on your iMac are going bad.  And...when testing the ports on your iMac, make sure you try them all and not just one.