Stuck in recovery mode and unable to install OS X El Capitan Hi to anyone able to help with this / having the same problem...

I use a 2009 iMac A1224 20" with a SSD, running macOS El Capitan (the shop which installed the SSD also installed El Capitan back in 2018.)

I recently been having some problems - spinning beach-ball, white screen / load bar freezing at 50% during start up. 

I cleared out disk space, installed updates, reset PRAM and verified the drive - none of this seemed to help.

Luckily it does actually start up every 1/20 times, so I've backed everything up externally. 

Initially I tried to re-install macOS, entering recovery mode using Command + R or Command + Option + R but only got in with Command + Option + Shift + R - I don't know if that's because it is an old model?

When trying to re-install El Capitan I keep getting "This item is Temporarily unavailable" with my Apple ID. I've tried two old Apple IDs and had not luck either. I've logging in to my new/current iCloud and Apple ID (made after these problems started happening) and seen my iMac is listed under my devices. 

I recently tried erasing the SSD / Macintosh HD but it's not made any difference. Now when I start up I loads straight into Recovery Mode automatically.

Also since erasing my SSD, the newly named partitions do not appear in the Recovery Mode Startup Manager - the section 'Choose Startup Disk: Select The system you want to use' is now blank. 

I am stuck in recovery mode and unable to install macOS X El Capitan.

Any suggestions?

Thank you
Everything you said tells me "hard drive failure." It is not uncommon for a system to have boot issues when the hard drive is failing. The fact that you can't see the other partition and "this item is temporarily unavailable makes it sound like that's the issue. 

Often when you try to reinstall the OS with a failing hard drive, you will get errors. This is primarily due to the hard drive having to write a file (the new OS) to the entire hard drive, whereas if you're using it, you're only accessing specific parts of the hard drive. You may have been avoiding that one "failing" spot, but when reinstalling the OS, it hit it.

I'd highly recommend taking it to an Apple Store or AASP (Apple Authorized Service Provider) and have them run a diagnostics check on it to verify. Or if you have an external bootable usb drive, attempt to boot into that.