Transmission and Throttle position sensor question

Ok,so right before Christmas, i bring my car in because the RPM gauge is inexplicably going up and down and the car revs it feels like the transmission is slipping. They had to have the technician drive the car home to find the trouble because the problem wasn’t repeating when i was there and there was no check engine light on. They determined it was the transmission and rebuilt it(covered entirely under warranty). Ok, to New Years eve i get it back and as soon as i drive it up the road, its still acting weird same problem i brought it in for. I brought it in the monday after 1/4/10 and the car of course was behaving for the repair place. Now yesterday the car was being really crazy. RPM gauge acting like it was possessed. Finally the check engine light went off. Now they said its the throttle position sensor. Could a transmission problem or a badly rebuilt one cause this to happen? It was the same problem happening that i brought in for before Christmas. This is the first time the ck engine light had went off. Any opinions?