With that setup, it could be either the pump or the tank. Or selector valve. But I'm guessing either tank or valve.
There are a couple of versions of that valve used by different setups. I have seen one that is switched by fuel pressure from the tank. To select tanks, you switched the different intank pumps on.
Not that way on yours, of course.
Then, I have actually seen one that was motor driven. Odd.
Most of them are solenoid nowadays I think.
But of those, there are a couple of types. One has a solenoid on each end, and one is spring loaded with a constant duty solenoid.
Its possible that it is not switching all the way over due to algae build up in the valve. There is only supposed to be two positions, but half-way might block the ports.
I gotta throw this one in, because I see all the weird stuff. Not likely in your case, but if it quits on the front tank again, try opening the filler cap.
Might have a plugged vent.
I would put money on the algae build up in the valve.