Hello and thank you for trusting us with your question. I'm DJ.
There's two parts to the throttle position sensor. One part is like a volume control on a radio. The other part is an on-off switch.
The on-off switch or the wiring to it is the problem.
There is a brown-black wire that goes to the TPS. Right next to it should be a yellow-white wire but that could vary.
This is the wire to the idle switch in the TPS. Probe that wire with a thin needle or a lapel pin. The idea isn't to poke a big hole in it with a probe. We need to measure the voltage. So hook the black lead of your volt meter to the negative post of the battery and the red lead to the needle that's stuck in the yellow-white wire.
With the key in the RUN position, the voltage should change when you first start to open the throttle. I expect that you're not going to see any change.
Try this test and let me know what you find.
The ECU turns off the injectors when the throttle is closed and the engine RPM is over 2000. The ECU thinks you're engine braking and coming down a hill so it shuts the fuel off.
If the switch part of the throttle position sensor isn't correct, it will turn off the injectors when the engine hits 2000, just like what's happening with your truck.
Please test the voltage on the yellow-wire or the wire that's right next to the brown-black wire on the TPS and let me know what you find. We'll figure it out from there.