OP:
Again, you have never told us WHAT YEAR the iMac was made.
Having that knowledge changes everything.
If you were able to download the Mavericks OS installer, I suggest you try BOTH of these:
DiskMaker X:
Install Disk Creator:
macdaddy.io
Use a USB flash drive that is 16gb or larger. (8gb -might- work).
The version of DiskMaker I linked to is the one for Mavericks.
I'm NOT SURE if the Install Disk Creator app will work for Mavericks, but if DiskMaker fails, try IDC anyway, just to see.
Again, you have never told us WHAT YEAR the iMac was made.
Having that knowledge changes everything.
If you were able to download the Mavericks OS installer, I suggest you try BOTH of these:
DiskMaker X:
Install Disk Creator:

Install Disk Creator -
Install Disk Creator Make a bootable macOS installer in a few clicks 5M+ Downloads 3.9/5 Rating 100% Safe Download Install Disk Creator 2.2 MB – macOS 11+ – Digitally signed Follow @BenedictSlaney 📘 New: Complete Guide to Bootable Backups on Apple Silicon Learn how to create a fully bootable...

Use a USB flash drive that is 16gb or larger. (8gb -might- work).
The version of DiskMaker I linked to is the one for Mavericks.
I'm NOT SURE if the Install Disk Creator app will work for Mavericks, but if DiskMaker fails, try IDC anyway, just to see.