Reminds me of something my Cavalier Z-24 3.1 used to do. It would "hunt" for an idle speed. It hesitated/balked when you started to engage the clutch, and about the time you thought it was going to stall, it would take off like a bandit, squawking the tires. Very irritating...

Measured the output (center terminal) of the TPS with a voltmeter as I slowly opened the throttle (key on; engine off). The output voltage should increase smoothly as the throttle is opened. In my case, it did so, except that the voltage would drop to zero at certain midrange throttle positions. In other words, my TPS had "dead spots" in it. Hmmmm-!
A trip to the auto parts store, a new TPS, and the hesitation was cured. The "idle hunt" disappeared as well
.
No idea whether you have the same problem - it's just a thought. Test the TPS before you replace it.