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:

Make a Bootable USB macOS Installer Download the update for Big Sur compatibility -
What’s needed for a clean install on a Mac A backup of the disk before it’s erased. Two options are to use Duplicate (a free utility which can copy and paste an entire bootable volume), or Mac Backup Guru (a paid, fully featured backup utility with unique incremental backups capability) for...

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.