My 2004 X Forester with 136,000 miles has a problem when starting and the engine is warm. Typically, driven at least 20-30 minutes then off for 10-20 minutes, on approximately 30% of the starts the engine briefly turns, "knocks" and dies with a clunk. Starts and runs typically on the next try or two. Does not occur if the car is not used for the day or overnight. Dealer could not diagnose the problem. A local mechanic duplicated this issue - found a possible issue with the timing belt and pressure sensor but addressing both did not improve the symptoms. The starter and AC compressor were replaced recently (just before starting issues) as well as crank pulley / crankshaft (after problems began - crank pulley separated). When engine starts, starts smoothly and runs as well as expected with the mileage.
Any ideas are appreciated