Yes, the box will react stry due to the rear sensors faulting. 2 540s I know (inc mine) shudder under WOT and tight lock (accompanied by the EDC light flickering), due to something esoteric, so maybe dirt or faulty sensors cause problems that can be minor OR major.
The boxes are very strong so don't think the worst. A common problem is the temp sensors in the box going bad, an easy fix and one that often **causes** or contributes to failure if left treated. Don't fret, it's probably straight forward.
Change the box as a last option- check the change schedule the existing one has had before doing anything. Change the fluid (w the exact right stuff- check the boxes ID plate for green or black model number print- green means a synthetic fluid, though no matter what one must use the exact right grade) several times in a month first. Get the level right by the book, or ensure that whoever does it can read the trans fluid temp in real time via their diagnsotics gear (it has to be able to talk to a BMW).
BTW: Beware what people might have put in it if it hasn't always been dealer serviced in the past. Do the filter after the second/third change.