My 04 did this... and it turned out to be lift pump failure and that lack of fuel to the injection pump caused it to not function correctly, and it surged... I like you thought it was the TPS... . throttle position sensor... .
The 100K warranty did the lift pump and injection pump at no cost... later when the mod for the in tank pump and gauge came out we switched all our trucks over... . and have not had a problem since... .