Here's a video on a typical 722.6 transmission controller/computer. As you can see there's scope for lots of weird problems.
I appreciate your transmission may check out OK when your friend tested it. But that's the pattern you describe an intermittant fault when the car heats up that could be engine or transmission related or electronic. You need to get your friend to test the transmission when the fault is present-what they call live data. I could be barking up the wrong tree here of course its just one of several possibilities.
OK, this is what we did today, spent most of the day on this.
Have found another Transmission out of a 320 CDI, exactly the same, but was hit from behind, so asked if I can borrow and replace some parts.
I also placed it onto a code reader, Not Star as no access to one till next week.
Came up with Air Flow MAF issues, which is for these 320 CDI's like a default code, No Other codes was logged as we did wipe it all clean last week.
I took the whole fuel rail out of the other vehicle, as I still suspect some issues, but no difference.
Then took the fuel filter housing off the other, checked the rubber "O" ring and even placed some grease around it for better seal. No Difference.
Took the fuel line from my behind the seat pump and noticed around the clip, a slight pinching at the end outlet from the in tank pump, cut it off as not a lot of hose to work with, and used my own General Utility Clamp and took it for a run.
(Well, was sluggish for a little nearly stalled as I entered the main road, but then it must of cleared it's air issues and Bingo, I have double the power.) Well not double but you can feel the extra horses.
Plus the kickdown worked from a stop start OK, plus when you drop down to 20mph and plant the foot you had a kickdown and up to 6k in RPM and smooth changing.
But when it got HOT, and driving like a Young Gun, the EPC warning came back on. Making it only go to 3k in RPM. Stop turn off and all resets, till you plant the foot again, but it's got lot of power.
End result and one issues solved is NO More Sucking Air.
So, I had a gearbox on offer was going to drop mine and place the other in, but after one victory, decided against it. Tomorrow I will look at my MAF, do a test on it, but the other car had their MAF missing, someone got to it before me.
(For those reading this, can I tell you, if you fully flatten or Remove your battery, these 320 CDI will come up with 3 malfunctions, being ABS and LIM and others, just take it for a short run, make sure you pull over, turn it off and REMOVE the key fob, and start up again all those malfunctions will go away) Do not think it's the end of the world if all the lights on the Dash come up as you have either removed or have a close to flat battery.