RPM is all over the place 2009 GMC Yukon 5.3

2009 GMC Yukon

I have a 2009 Yukon 5.3. Has anyone had this issue?
Pulling these codes and changed all 02 sensors and had codes cleared. Have inspected the wiring harnesses and those look fine as well. RPM is all over the place when idel and warmed up. up down up down and lights dimish bright surge with the RPMs. Battery and alternator are fine.

Any help would be greatly appreciated.. my gas mileage is killing. Thank you

Generally anything that effect the idle of the engine and not just the gauge twitching around is caused by a vacuum leak. This vacuum leak can be internal or external. Knowing the codes usually will help point you in the right direction. maybe you could post them below in the comments.

Double check your work

If the issue you are now having didn’t exist before work was done then the next best approach would be to double check your work. A vacuum line could have been left loose or even a loose hose clamp from the air filter hose to throttle body can effect the idle. The next thing to consider would be if the IAC valve is leaking internally or an intake gasket is leaking.