I'm assuming you've already checked for both engine and transmission fault codes?
you know when you say in 3rd and doing 40mph - you want to overtake someone and the gearbox will drop the gear to 2nd - well in make case it doesn't drop the gear anymore, unless I change it manually.
I would check the voltage range output of the TPS to rule it out as a possible cause.
You'll need a multimeter with some 'modified' probes, twisting a paperclip onto the end of each probe works well, or twist a paperclip onto a couple of lengths of wire that you can connect to the meter probes. Find the middle connector of the ECU, look at the wire side of the connector with the clip facing up. The terminals you need to test are 9 and 10, the furthest right 2 terminals on the bottom row.
Using the paperclip modification (by pushing the paperclip into the wire side of the connector) connect the black probe of the multimeter to terminal 9 (E2 sensor ground) and the red probe to terminal 10 (VTA - TPS output signal), ensure the 2 connections cannot touch each other (use some insulation tape if needs be), set the multimeter to 20v DC and then turn the ignition ON. (The connector must remain plugged into the ECU)
You should see a reading on the meter of between 0.3v - 0.8v. Next slowly press the throttle pedal and watch the voltage reading on the meter, you should see a linear increase in voltage as the pedal moves closer to the floor. With the throttle pedal on the floor you should expect to see a voltage reading between 4v - 5v.
If the voltage reading suddenly drops whilst testing without the throttle pedal being released, then there could be a fault with the TPS or the TPS circuit.
The main purpose of this test is to confirm the TPS ranges correctly and to identify the TPS output voltage when the throttle is wide open.