I first tried to replace the key.Hello ,i think we have found the problem ,the flywheel in the past has come loose on the shaft causing the damage ,you will need to clean the two grooves and using a new or perfect key put it together, if the groove on the engine shaft is not perfect the key will not locate the flywheel . There is some liquid metal stuff in tubes that may mend the damage though .Gary
As I live in Belgium they have no stock of imperial keys only metric, so
I bought a 5 x 5mm oversized and filed until it fitted on the crankshaft.
Stange,it did not fit on the flywheel, so I filed half of the key to fit the flywheel.
Strange that it is not a square size.
The key fits now in both, but is asymmetric.
The engine doesn't make a knocking noise anymore on a first test.
As it rains today I hope to cut the grass tomorrow, let's hope it stays ok.
I will let you know in a few days if everything is working.
Thank you very much for your help.