When new, my 92 ctd had the same problem. Random shifting, then no overdrive at all.

Went through numerous tps sensors, the problem always kept coming back. It got so bad I would just pull up the the mechanic's bay & pop the hood. We would go to the counter, by the time the paperwork was done, he had the truck fixed.

The last fix was tps sensor, speed sensor and the dealer put a short speedometer cable (10" long) between the speed sensor & transmission to isolate it from vibration.

Never had a problem since.

Ed