Sounds similar to a problem with a Honda which turned out to be due to the oil switch detecting crappy "lubricant" and stopping the sparks department.

https://www.outdoorking-forum.com.a...a-gx160-only-runs-for-a-few-seconds.html