Dude, don't tow crap yet....certainly not to the dealership. I got my car a year ago, it had 72k miles....car run great till I hit high rpms, like passing someone to get in front of them or when pulling into a street on an uphill.
I'm not diagnosing your car or saying I know what it is...just sharing the fact my car behaved the very same way, even to the very same lights and color on dashboard. It did the same thing and would not go past maybe 5 mph until i turned off and restarted. Funny thing is car would be fine until I reved it up a bit....hahahhaha
When I went to mechanic the guy wanted me to describe and I just offered to "trigger it" for him to demonstrate. I could make the car do it on command. I think it was 4200rpms, on any gear, at any speed.
Codes were P0302 Cylinder Number 2 Misfire Detected, P0171 Fuel System Too Lean (Cylinder Bank 1) and P0174 Fuel System Too Lean (Cylinder Bank 2) ...basically Indy mechanic diagnosed bad Throttle Body. $650 labor included. Car runs amazing now.
I don't know where you live and don't know what the Indy mechanics vs dealership situation is in your area, but will highly recommend you look for someone who knows BMWs and is NOT a dealership. Unless you have deep pockets and just want to pay extra for something someone else can diagnose and fix for way cheaper no matter what it ends up being.
Good luck my friend.
2003 Z4 2.5i Black/Silver