Last time for me ,
If the line INSIDE the tank is loose or has a split, fuel will still run out the front when there is no resistance ( as in an open line )
Ask it to build system pressure and the fuel chooses the easy route and pushes through the split and doesn't flow forward anymore.
A really lame pump can exhibit similar symptoms.
Can flow fuel at zero pressure , will flow nothing when asked to build pressure.
Rarely bad grounds can show similar simptoms but I doubt it here.
As in bad ground , the current finds a new route to ground like, through a lamp filiment.
As it to make pressure , the draw goes up and the " new path" will not carry the load and the pump stops.
Good luck with your search.