I assume your pc originally came with Windows 7 pre-installed right?
This, you say, stopped working so you installed another version of windows 7 and tried to use the same key which came with the original.
You cannot do that.
The original version of windows that came with the machine is what's called OEM and the licence and key are not transferable to either a new machine or another version of windows 7.
If the original copy of windows was still working on the original HDD then you could have upgraded to windows 10 free of charge as long you met all the requirements.
Unfortunately now the original copy has been lost (the original HDD may well have had recovery partition containing a copy of windows so you could restore back to...