The error "Disk Not Ejected Properly" indicates your external drive was disconnected without being ejected first. This may result from disk sleep settings, faulty USB cables or ports, insufficient power supply, disk corruption, bugs, etc.
Here are my suggestions:
Use a different cable and port. I understand you've checked the cable and port, but I still recommend you try a high-quality Thunderbolt cable and use a different USB port because I've seen users reporting success after changing the cable.
Use a different adapter or a powered hub. If you're using an adapter to connect the drive to your Mac, switch to a different one, preferably a self-powered hub. Besides, you can also directly plug it into your Mac. (If your drive has its own power cable, ensure it's plugged in.)
Disable disk sleep settings. Go to the Apple menu > System Settings > Battery > Options, then set "Put hard disks to sleep when possible" to Never.
Reformat the offending drive. If the automounting issue is caused by disk errors, reformatting the external drive on Mac will do the trick. Just be reminded that you must back up your drive before reformatting it.
P.S. If the intermittent disconnecting has made your disk inaccessible, you can run iBoysoft Data Recovery for Mac to get it back. Click the button below to preview the lost files for free.
For more solutions, check out this guide:
[Ventura] Fix External Hard Drive Keeps Disconnecting on Mac