Could this be a Throttle position sensor problem?
Or something else. on 2001 Chevrolet Blazer

idles rough, RPM fluctating , vehicle has stalled at stoplight but restarts right away.

2 answers
it could be many things. but you can start by replacing fuel filter if over 2 yrs since last filter changed. need to check fuel pressure and check fuel pump.
Check the EGR valve. I've seen carbon keep the valve open causing rough/surging idle and stalling