chevy avalanche question sensor related

ok its on my dads truck, new plugs,wires,air filter, it has a miss at idle and idles really low like 400 rpm. if you hit the gas the rpms go up then quickly drop and when they drop the lights all dim and it stumbles very lightly, the ses light is not on, we had it scanned and it said random misfire, but i think its one of the sensors on the throttle body, what could cause this condition, also tried swapping in a coil to try finding a bad one and the problem never went away