Before reading my answer below, please note that you must press the green ACCEPT button in order for me to receive credit for my time and effort. Thank you.
First thing to do is check the fluid level to make sure it is full.
If the fluid checks out okay, then this could possibly be caused by a bad output speed sensor, on internal wear.
You would need to have further testing carried out by either BMW or a good transmission shop to verify, however, as it is not possible to say 100% which is the problem with only that code to go on.
Also could possibly be a bad connection or loose cable somewhere as well.
I hope that is helpful, please let me know if you have further questions, or if I can clarify anything for you.
It has been my pleasure to help today and I wish you the best of luck with the vehicle.
If satisfied with my assistance, please press the green "ACCEPT" button so that I may be credited for helping today. I am not credited or compensated whatsoever until you press the green ACCEPT button.