It might need a new battery. The 99% of the AMG batteries are failing when they became 4 years old, almost like having a timer set in them. We had 6 replaced just in 1 month, all on 2006 BMWs and MBs.
You need to register the battery to the car. It has an intelligent charging system, which "has to see" the battery, otherwise it won't charge correctly and cause various issues in the future.
The OE battery is a AGM, and if you don't use an other AGM, vent hose needs to be installed also to prevent corrosion.
Take your car to a BMW specialist or to the dealership and ask them to register the battery to the car. It needs OE or equivalent diagnostic computer to do, so Autozone and other similar parts stores can't do it.
Battery replacement is not an easy DIY procedure anymore, you can easily cause damage to high priced components if you don't do it correctly.