Sorry to hear that. Why not try to run Disk Utility First Aid to repair the startup disk in Recovery mode?
Maybe certain errors on your Mac hard drive make your Mac won't boot from a Time Machine backup and get stuck at startup.
- Enter macOS Recovery mode.
- Select Disk Utility.
- Select the Mac startup disk from the sidebar and click First Aid.
- Wait until the process is done.
If your Mac still doesn't boot, try these tricks:
Still useless? You have to try formatting the new SSD to APFS:
- Enter Recovery Mode
- In the macOS Utilities window, select Disk Utility.
- Select your SSD from the left sidebar and click on the Erase tab.
- Choose APFS as the format and provide a name for the drive.
- Click Erase and wait for the process to complete.
After the formatting is done, exit Disk Utility. And then, use another healthy Mac to install Catalina onto your SSD to create a bootable macOS installer. Then, you boot your iMac from this SSD.