Trouble code 9 is related to No.1 TDC sensor. (situated behind the camshaft pulley) It does not neccesarly mean the sensor is at fault but can also be caused by the ignition/valve timing being out.

Interesting that your engine light bulb was out, presumably the light had been on with a previous owner and they either could not or would not sort the problem out.

The sensor it self should have a resistance of 700 - 1000 ohms when checked with out the engine running. (its basically a coil type inductive sensor)

With out hearing the noise/knock its difficult to say where the problems are. could be a loose tappet adjuster or another problem relating to the work just carried out rather than a failure of something else.

HTH