this is most commonly caused by a failed throttle body or failed throttle body wiring harness.
you should have the faults read from the car using a factory BMW scan tool or equivalent as this will provide much more detail than a generic tool. the wiring harness throttle section also needs to be checked carefully
Sorry if you were hoping for a different answer, please don't shoot the messenger - I can only give the honest answer, which I have. Please remember that a low rating PUNISHES me for my honest and prompt response, and I receive nothing for my time and answer until a positive rating is clicked.Please let me know if you have further questions. Please do not forget to click a positive rating as this is the only way I receive credit for my answer, thank you. Best wishes with your vehicle