Out of curiosity, how did you make that work? The 22RE has a separate TCU, and an A340F is usually controlled by the engine ECU. So that's where I'm confused. It doesn't seem like a very straight forward swap. I'll go with electrical just based on that, but who knows.
A VSS is easy to test. With a continuity meter attached to both leads, spin it and it should give you continuity exactly 4 times per revolution. And then make sure that it is receiving 12 volts.
Also, a lot of people don't realize that the A340F needs two different speed sensors. One of them is in the transmission and the other is in the combination meter. That could be a problem.
EDIT: One more thought. I have heard that shift solenoids going out is a common problem. This is a possibility since the problem seems to be intermittent. They work on a system of 2 solenoids. First gear is #1 on #2 off. Second is #1 on #2 on. Third is #1 off #2 on. Fourth is #1 off #2 off. That may help you to determine which one is the problem.