Trans fail safe mode on 1995 BMW 840Ci

The symptoms are:
The first time I was waiting for a green traffic light when suddenly the car wouldn't go. I looked at the OBC and the trans fail message was there. I pulled out the key and start the car again has if nothing happened. The second time the car did started running, but very very weak, as if it was running in the first gear. Same thing; I pulled over, pull out the key and started the car again as if nothing happened.
I took my 840 to the mechanic to perform a scanning after the OBC showed the message and the diagnosis was:
042($2A) Speed signal n-ab
I got the Speedometer Sensor - Located in differential
Part # : 62 16 8 357 020
will this solve the problem or should I'd be looking for something else?
Any help will be appreciated.

BMW and Mercedes are VERY sensitive to power drops and loss, so check the computer list of possible faults to see if low power was detected. Dealers love to go for failures of the sensors, servo and mechanical faults but all don't fail at once. I'm and Engineer that read the faults bought a new battery and reset the codes and the car has been driven for over 2 years since and yet to change any of the sensors, servos or transmission. Check the electric first.