With the engine (coolant) temperature sensor or wiring. Got a code 13 along with the same click starting issue. Disconnected battery to clear the code, tried to start the car and it started right up. Turned it off, no start and code returned. It’s the original wiring harness and is very stiff with an awkward bend near the connector. I suspect one or both of wires has broken within it near the connector, likely the ground circuit wire preventing the start. And my theory is when the wire is jiggled it touches sometimes into place and the car starts which would explain the intermittent aspect.
I Ordered a new pigtail connector and sensor. We will see if this does the trick.