Most likely the old internal hard drive is failing which could explain the initial reason to have it replaced and everything else with it connected externally.
Disconnect the old hard drive and boot the iMac into Internet Recovery Mode using Command + Option + R to attempt to access the online macOS 11.x Big Sur installer. Install macOS to the new internal SSD. Once you get macOS installed, then you can try to migrate from the old hard drive if you don't have any backups, but I'm guessing this will fail due to the original hard drive physically failing. A failing drive can easily cause problems even when booting from external media such as the online macOS installer.
If the original hard drive is failing and you don't have any backups, then you need to be extremely careful here since attempting to access data from a failing hard drive will just make the failure even worse since macOS and most utilities (including data recovery) cannot handle the errors produced by a failing drive. You can setup a new account on the fresh install of macOS on the internal drive and try running the third party app DriveDx (trial period available) to check the health of the original drive, but you will need to install a special USB driver to do so. Even with this special USB driver, the Sabrent enclosure may prevent the necessary communication to access the drive's health information (I've never tested a Sabrent enclosure). Feel free to post the complete DriveDx text report here using the "Additional Text" icon which looks like a piece of paper.
Also, as @kaz-k mentions, using Disk Utility to clone a bootable macOS volume is doomed to failure even though theoretically it should be possible, but it is unreliable. Third party options are much better...never had any issues.
If you don't have backups, then I hope this issue prompts you to begin backing up the computer and all external media (including the cloud) which contains important & unique data. While it may be possible to have a professional data recovery service recover data from a hard drive, it is nearly impossible to recover data from an SSD. Plus SSDs can fail at any time without any warning signs....even a brand new SSD.
If you do have a backup, then I would suggest installing macOS to the new SSD and restoring from the backup.