In my opinion, there's a bug in recent versions of macOS that causes (for some users) this "Disk Not Ejected Properly" message to pop up for drives that had worked perfectly reliably in older macoS versions. I've read several threads about it. For some people (like me on Monterey) it happens only about once a month or so; for some it happens every couple of hours, even disconnecting during file transfer. From the posts I've read, the issue seems to possibly have started in Big Sur, and be mostly noticed in Monterey (like me) and Ventura.
It happens (infrequently) to my iMac, but I've been able to determine that the the drive actually gets disconnected and immediately reconnected, sometimes to a
different device node! For example, a drive (partition) originally shown as disk7 (in 'diskutil list') got reconnected as disk4!
I've even gotten "Disk Not Ejected Properly" for the
internal SSD (Apple original) of my 13" Early 2015 MacBook Pro running Monterey. (No other errors or signs of any problems with the storage -- everything works fine.)
Here's a couple of the similar threads:
https://forums.macrumors.com/thread...ly-messages-after-waking-up-computer.2321141/
https://forums.macrumors.com/threads/disk-not-ejected-properly.2381272/
Of course, for external drives, the issue could be a bad cable, port, enclosure, or power supply... so those aspects should be examined closely in each case. The usual advice is to try using a different cable, then try using a different port on the computer. If those don't solve the problem try a different enclosure (and/or USB hub, if one is being used).