Hi and Welcome. My Name is ***** ***** I look forward to assisting you today with your question.
That error indicates a issue with internet that prevents the necessary files from downloading to reinstall OS X. Since you are getting that error, that means the core components of Mac are working. So it is related to hard drive issue.
You don't have to go to Mavericks. It even support latest Sierra.
So my question is, how did you create the USB drive ?
And what method did you use to boot into that drive ? Did you hold down Option key at start up ?
Hi Siobhan, That is a error related to internet. It is not necessary to reinstall Mavericks. You could have created the disk with DiskMakerX and it should've worked. Anyway, I'm glad you sorted it out