How old is the battery? Since you have a 2012, that would be one of the first things I would check.
Also ground cables, are another area the is troublesome on BMWs, these cars tend to have random codes when voltage is out of spec.
You can use realoem.com and newtis.info to locate the grounds as well as part numbers.
2011 BMW X3 F25 N52
2015 BMW 328i F30 N20
2011 BMW X3 2.8i (F25) N52
2015 BMW 328i (F30) N20