Helpful siteThis site might provide some help. Using a separate fuel supply is an excellent way to isolate the issue. It could be as simple as a loose hose clamp. Mine was. If the clacking noise is the fuel pump it might indeed be sucking air or have a faulty pick up tube. If the clacking stops with the external fuel supply it would be because the fuel bowl float has cut the incoming fuel off until it needs more. I don't think it shuts the pump off it is just the design of the thing that makes it go quiet when up against pressure. Since the pump was changed it is unlikely the issue. I would do my best to connect a new piece of hose directly to the fuel pump input and bypass all existing hose lines.
I once found with great difficulty, some silicon sealer floating in one of my boat fuel tanks. It would float around and cover the screen in the pickup tube at the bottom of the tank. Under heavy throttle the fuel demand would suck the little flap tight and the engine would stall. I could idle all day long. My second tank never gave me a problem.
It might be possible that your fuel tank is not venting and the generator just can't suck the fuel up when the tank has a vacuum built up. Acts like a vapor lock. On my 89 Ford as many many others have found on Fords the internal fuel tank caused a lot of grief for the main engine. Your symptoms may vary with different levels of fuel in the tank, outside temps, or climbing a hill on a hot day.
My new mh in 08 has an 8KW Onan diesel generator that gave me fits. Similar symptoms. When the fuel tank was full it ran fine. The hose on top of the tank pickup tube was never tightened from the factory. It would idle nice, run most of the time, but under heavy loads it would act like it was starving for fuel, which it was. It would prime again (clack clack clack) and start right up. A few turns from a nut driver solved the issue.