First thing, order the foxwell nt510 scanner with the BMW software off Amazon and pull the codes. Report back here with that you find.
Second go here:
https://www.bmwusa.com/safety-and-emission-recalls.html and put in your VIN
There was a recall that replaced the timing chains on your engine, if it's been done already it won't show it's available.
Metal shavings in the vanos solenoids caused by the timing chain is a new one on me, never heard of that. Highly suspect these folks know what they are doing....if it is metsl shavings you have much bigger issues to worry about as this usually indicates bearing failure, give us more details on how the at ran (did it just die, did it still run but reduced power, would the error go away after restart then come back?)we need the codes from your car to know more. It could be as simple as just the plugs or coils, which are very common to go out. You have next to the most expensive engine to work on, you need to be armed and know what is going on or you are going to get worked over hard, and not even get a complimentary reach-around....