It seems that not the improper ejection of the external hard drive causes the error "macOS can't repair the disk". From your description, I guess that there are some errors on the external hard drive that make this trouble.
But you can try these steps to check if the error can be fixed:
- Right-click the external hard drive and select Eject and then unplug it.
- Restart your Mac.
- Reconnect the external hard drive to your Mac. You can connect the drive to another port on your Mac.
If the issue continues, follow what the message alerts you to do. The error message says that you need to back up the disk and then reformat it. But transferring the 3TB data on the drive to your Mac is an arduous task and may cost much time.
So, I suggest you use disk cloning software. This tool can help you back up everything on the disk to another external hard drive at a fast data-transferring speed.
iBoysoft DiskGeeker is just a disk management tool that contains disk cloning functionality. It can help you transfer all data on the source disk to another disk at a stable and very fast speed.
After backing up the data on your drive, don't rush to format your external hard drive on your Mac. You can use Disk Utility First Aid to repair the disk first. If Disk Utility can't repair the disk, then you can format it.