I hope they didn't do a Ferris Bueller to your ride lol.
Seriously - the code will be stored and you can find out what tripped it. Sounds like you may be on the right track re: the gas cap. The first "mod" every BMW should get is a CAN tool...
Show us some pics of the wheels!