I'm unaware if there are differences between M52tu and M54 engines, but your issue is exactly that of my 328i. Coming to a stop in gear, the second I took it out of gear, the car shut off at the light. Sometimes I didn't even realize it was shut off. The solution wasn't apparent right away, but it took several weeks of driving like this to trip the code. I had a really hard time starting and often times it would put it self in safe mode.
Solution: Intake Camshaft Position Sensor. I was at 106k and was the first repair I had to perform. Easy 2 hour job with cleaning the intake tract.
Could be a wheel bearing issue. Wait for Dane to respond.