This is from YD25.com.au
"The computer in D40 vehicles with VIN MNT is programmed to check the correlation between the camshaft and the crankshaft and shuts the engine down within 5 seconds of cold start-up when the fuel pump drive timing chain is worn however if the engine is hot (over 65 degrees C) then it will idle and not shut down. To confirm that fuel pump timing chain wear is the problem, ensure the engine temp is below 65 deg, disconnect the camshaft sensor plug located on the cylinder head, left hand side rear, and restart the engine. If the engine does not shut down after 5 seconds then the fuel pump drive timing chain needs replacing.
In all other models VINs VSK MNT JN1, if the engine only runs for a short time at idle or if it only runs when the revs are kept over 1500 rpm then this is an indicator of serious wear to fuel pump drive timing chain, camshaft timing chain and guides. As there is no computer shut down in these models, the engine will run until the fuel pump drive timing chain breaks.
In any model, if the engine has a timing chain rattle on start up and the noise goes away just after the oil light goes out or if there is no noise when cold but the chain rattles when hot then this is an indicator of failure of the top tensioner. These symptoms can occur at relatively low km. A failing top tensioner is a serious fault and needs immediate attention. Our timing chain replacement kit includes genuine tensioners with a special part that improves their reliability.
The signal pattern of the crank and cam angle pick-ups can be checked with scoping equipment. New chains will show overlapping cam and crank signals. Worn chains will show time delay on the cam signal. The MN D40 shuts down when a delay of 18 degrees is detected. Use this method with caution as it will not identify if there is just one worn link."
Just some food for thought, I'm dreading this as well as mine has 250 on the clock and lifespan is 300k.
I usually research the hell out of my cars before purchasing, no idea how I missed this one.
Hopefully yours is just a vacuum leak or something dodgy like a PCV.