You didn't say how old your 5000 was but I have had the same experience on my 2000 Onan 5500. Problem showed up in summer heat, would run great on the road for an hour or two and shut down. Cool off an hour or so and it would run again. Certainly appeared to some sort of fuel pump issue in the heat.
Turns out it was the fuel line leaking air coming from the main tank.
It is an easy check to disconnect the fuel line at the pump and replace with a short hose dropped in a gas can. Mine ran in the driveway for 6 hours in 100 degree heat and never shut down.
I replaced all rubber hose and metal hose sections with a new one piece heavy duty fuel hose and my problem was fixed. No issues 4 years later.
Cheap test and fix. Certainly can test the fuel pump as well, and that could be it, but if its the fuel line a new pump won't help.