I started the car and the car shooked and turned off what is the cause off that? on 2006 BMW 325xi

A couple weeks ago I took my car for an oil change and the next day when turmning on my car the car started shaking, trembeling and car would turn off when came to a complete stop. So I took it in again, they said it was the gas cap that was lose and that air went in and reacted. However I kept getting a the signal of a red car on my dash screen. I told them about it and they said it was because I need back rear breaks. well weeks later TODAY, I turn the car on starts, proceeds with a tremble and stops with a check engine signal. Obviously the dealer is pulling a game, but it's more than that. Your guidance, pointers, are must needed and appreciated. Thank you

Asked by for the 2006 BMW 325xi
My 04 BMWxi is doing same thing. I bought a new crank sensor, changed spark plugs to Bosch db platinum. If that works have O'reileys run a diagnostic could also be a coil pack. Also check fuel filter could be clogged and not getting enough fuel. Also last resort could be Air Mass Flow Sensor. Let me know what fix's it at name is Matt and good luck.
Thank you for replying a year later. lol The problem was a coil issue, and it cost me an eyeball. Unbelievable! Merry Christmas