The throttle position sensor is mounted to the side of the throttle body.
What?!?! A different location?!?!
Greetings and Welcome to Just answer.
Your truck has the Electronic Throttle system. The Throttle position sensor is inside the throttle actuator assembly which is the throttle plates. It is not something that can be changed separate from the throttle. The sensor on the pedal in the truck is actually 2 sensors and are called the Accelerator position sensors.
These years of trucks with the electric throttle have a couple of very common issues. First and in my experience most common is the ground wire. The ground runs from the rear harness behind the top of the engine to the rear of the left cylinder head. It is attached at the same bolt as the ground strap at the firewall. I have always been able to find this by pulling on the black wire and see if it gives. The fault has been a conductor broken in the insulation at the crimp. The second issue is the wiring near the throttle body. The wiring tends to break a few inches from the connector. check these out and see. Another common issue is the wiring near the throttle body itself. There are some wires there that can break inside the insulation and cause this. Check the wiring carefully near the throttle and about 6" back.