The problem was resolved by changing the power supply. I followed the ifixit guide for a 17" machine, mine was a 20" iMac.
Basic fixings were the same but in slightly different places.
The main difficulty was the main snap on connector for the power supply(black one) was routed under the chassis and I couldn’t get to the connector. Cutting the black wire from the faulty Power supply close to the PS as possible, made it possible, with tweezers, to re route the wire, under where the hard drive would be replaced, there was enough space under there, and it hasn’t caused any problem.
All works well.