2004 Chev Impala jerking upon shifting

My 2004 chev impala jerks upon shifting. It doesn’t do it all the time and sometimes it will go for days without it happening. And sometimes it revs a little before it shifts. I’ve talked with a transmission mechanic and he says that sometimes the throttle sensor will act up and it might help to replace it. Before I do, just wondering if anyone else has had that problem and if replacing it worked.

Check your service manual to see if the transmission has a service schedule and if it does, is it being followed?