It doesn't even have to be a bad pump.
On my bike, which had be sitting for many years, silt had been accumulating for many years in the bottom of the tank. So even though I replaced the fuel pump, filter and hoses, I too had an intermittent cut out problem (especially when the bike was warm - and the fuel level low) The silt was getting stirred up and blocking the fine screen that surrounds the bottom of the fuel pump. When the screen was blocked enough the engine cut out due to the reduced fuel flow. When I then let the bike sit for a while, the silt would dislodge from the screen and settle back down to the bottom of the tank.
On these bikes, the fuel is constantly recirculated in the tank, and when the fuel level gets low there is a higher level of turbulence in the liquid in the tank, thus lifting what sediments that there might be and allow them to get drawn into that fine, fuel screen on the bottom of the fuel pump and impede the flow of fuel.
Rigorous cleaning of the fuel tank with solvents and vacuum cleaner completely eliminated any and all foreign contaminants and solved my problem.
Generally most solid state parts (like the HES) do not go bad if they have been working previously. So I generally look for solutions in other areas before I will suspect the solid state parts on the bike.