RPM jumps up and down while driving

I have a 2015 Buick lacrosse. I have been having a problem with the RPM. I don’t know much about cars so I came here to hopefully get an idea of what it is. I don’t have any problems at startup. When I pull off it shifts into gear, the next gear shifts but you can feel that it didn’t do it in time (this only happens when the engine is cold and only happens once) after that the car’s RPM will jump a little bit and the car has a little jerk to it. Once the car is all the way warmed up the RPM still jumps. I have changed the spark plugs and got a transmission fluid flush. The problem is still happing. Does anyone have any idea of what this could be?

Are you sure it’s not simply the transmission shifting and the engine RPMs changing as a result? In most cars you’ll sense the shift - a little jerk - even if you don’t have a tachometer to look at. When an engine is cold, it’s normal for its RPMs to be higher than when warmed up, and be higher than usual when first underway.

Yes I’m sure it’s not just shifting. It’s shifts fine

Is it only while defrost or ac is on? I had that with my trailblazer 3 years ago, mechanic bud said disconnect the negative terminal of the battery for at least a few minutes, and reset the brains, I did that and all was fine. I do recommend turning off the fan, and shut down all air controls and ac first while running, as for some reason actuators can blow after a battery disconnect.

Sounds like the TPS or throttle position sensor