Please do not forget to click a positive rating as this is the only way I receive credit for my answer, thank you.
that is the problem. you need to take the car to the right professional.
these cars require VERY SPECIALIZED diagnostic equipment and expertise to diagnose. You absolutely must take this car to a properly equipped BMW specialist or main dealer. It doesn't matter how cheap a non-specialist is - if they can't fix the car they are of no value whatsoever
expensive diagnostics and repairs are part of owning a BMW, there is no way to avoid it, and using non-qualified mechanics to try a save a little bit of costs will not get your car fixed
Your symptoms suggest to me a failing fuel pump or other problem with fuel delivery, but I can only speculate based on the vague symptoms you have described - which can be caused by any number of things. you absolutely 100% must have the car checked by a qualified BMW specialist and also demonstrate the issue for them first hand - this is the only way to get to the bottom of your concern.
I am sorry if you were hoping for a different answer, but this is the honest truth. Please don't shoot the messenger. I can only be honest and realistic, which I have done. Please remember that a low rating PUNISHES me for my honest reply, and I receive nothing 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 repairs.