The accidental loss of connection of the external hard drive to your Mac caused the Disk Not Ejected Properly error. And improper ejection could also damage the external hard drive making it unmountable and inaccessible.
The Disk Not Ejected Properly error could appear due to a loose connection. If you find the external hard drive not mounting on Mac after the error, you could first check the connection to make sure it is firmly connected, then try to force mount the drive via the Mount button in Disk Utility and the Terminal commands.
If the drive couldn't be mounted yet, you can run Disk Utility First Aid to check and repair the disk errors on Mac. Then, you may try the last method - reformatting the drive to make it mountable again. This will erase all contents on the drive, therefore you should first recover data from it if you haven't created any backup. Download and install iBoysoft Data Recovery for Mac to recover data from the unbootable drive on Mac now!