Which fuel pump rely, did you replace? Names of parts can miss lead us.
What are the ECT (engine coolant temperature) as seem through tech stream, running?
Is the security light, ever coming on with IG key in?
Have spark plugs been replace, with know good ones (not some junk China bootleg)?
Any misfire observed in tech stream?
Few thoughts:
Keep a code read plugged in, on all drives. Scan as soon as event happens, without turning off IG key. We sometime can catch a lean condition or other DTC pending. Some disappear if condition clears on next system check.
Make sure wire harness running down LH timing belt cover, is going behind fan bracket and not visible. If running in front of fan bracket. Make sure it's not rubbing serpentine belt or pulleys cutting wires.
Double check grounds firmly connected, like one at firewall to engine at heater tees.
There is a TSB on cam sensor behind RH T-belt cover. But IIRC it's a cranking issue when trying to start. But worth checking. As not only TSB. But during timing belt service. Some damage it's wires or they pull bolts retaining sensors needlessly and don't get torqued back in.
The throttle body electronic can be damage or a sensor wonky. We should get a DTC, but may only be pending. One thing I never do is open the 03- throttle body by hand. Toyota does not say not too. But I've concern with damaging electronics in throttle body. That or if the wire harness loose, could produce issue of stalling. Your butterfly could close (lean condition), cutting air from engine (running rich condition). Look at throttle body butterfly as it opens and closes, while IG key ON (engine off) and someone depress gas pedal. Does it open and close all the way, and smoothly.
Look over air intake pipes, engine and under intake manifold for signs of rodents. Those little guts cause us so many issues.
Run through fuel pump and fuel pressure regulator test by the book.
If dying at low speeds (low RPM), after running at higher RPM like 2,500+. It does point to fuel flow or pressure issue. More thoughts along this line"
1) Make sure vacuum line on fuel pressure regulator, and all points and hose of air box and vacuum hoses snug (no vacuum leaks). This includes air pipe to throttle body, where sometimes pipe is curled up allowing air in at bottom of pipe (can't see). So inspect ever point of intake and vacuum. Monitoring fuels trims can be revealing. Also inspect air filter and air tube coming into from within fender, for obstruction like a nest.
2) Most common is fuel pump in the 06-07 resulting in shut down. I would think the new OEM fuel pump took care of. But it possible you got a bad one. I've never R&R with OEM. I've only used Denso (Not Toyota Denso), which we must remove pump from cage (housing/holder). With the Denso I've never had issue. But if Denso used it must be installed correctly at all points. Which an O-ring we must install, cage set correctly and wire house block connect securely.
3) Just recently a teenage in high school near me, made an observation (very smart and observant of him). He had stall issues, after installing air pump. The pump block the fuel pump resistor which is on RH fender, which has a heat sinks. He moved the resistor into air box, which gives constant air flow to dissipating heat. It's not been very hot here yet, but to-date he's issue cleared. About the some time. A builder and I talking about this fuel pump resistor. He's seen then go bad (not 100 series) on Toyota's. He also said we must have great than 2:" cleaner (air space). They will get hot (increasing resistance) and reduce power (volts/amp) to fuel pump, by to much at low RPMs. During high RPM, ECM routs around resistor and gives full voltage to fuel pump. Fuel flow/pressure drops at low RPM to much if this reply bad or over heating.
View attachment 2995964