My older JD D130 will run well for 10 minutes then start acting like fuel is starting to run out (cyclic revving) then die altogether. It will start up again much later and same thing happens. I've replaced filters and fuel pumps and had other repairs done.
Debris floating in the fuel tank will get sucked into the fuel outlet restricting supply
When the engine is turned off & there is no fuel flow, it will float away till the engine is run again
Drain the fuel tank remove the cap & blow a lot of compressed air backwards up the fuel line to hopefully blow the crud out of the tank
They are not fun to remove .