In which a misfiring spark plug or spark plug ignition circuit could cause a knock sensor detection code too… Also if possible when checking spark plugs, maybe try to look inside the spark plug holes with a camera scoop, perform engine compression test, ohms test spark, plug wires, ensure spark...