As usual - the posts reflect my experience as well.

The PO had replaced the exhaust riser and removed the sensor. That could be where you're getting shut down when it heats-up. You might ground that sensor on the riser just to see if that's the one. If so, you'll have to deal with whatever it kicking it off. I had an oil pressure sensor prevent mine from working last year, but that shut it down right away.

When the tech came, I had him go over this 20kw Onan. It runs nicely, but was dripping fuel in couple places. The 1st thing he did was what the guys above said. He got rid of that leaky fuel filter and bypassed it completely. Then, he replaced the pump with an electric.
The injector pump was dripping and had to be rebuilt. Only $1,800 later, it's running nicely and drip free.

I warned the genny, out loud in front of my daughter, that if it keeps having problems I'd replaced it with a new 16kw. So, maybe that little pep talk will help it keep running.