Happy Thanksgiving. and welcome to the forum. There are two batteries in your D. The main one, and a smaller one for the stop start. A number of Gen 3 D owners have been reporting that one or both have crapped out around the 3 year mark. If you have any of the 3/36 warranty left, your dealer may replace them for no charge.
I would get them both properly load tested, and replace if less than 100%.
It’s likely the smaller battery. You can run w/ the larger one for a while (I’ve been running for months trying to wait my lease out). I disabled stop/start in the unconnect settings to make that alert go away. It was annoying having the car cutout at red lights anyway.
You can try to recondition the battery by yourself. If this doesn't work, you will need to buy a new one. You can find different methods of how to recondition a battery on batterytools.net. of course this problem can be created by different factors, for example, the generator. If it is not working well, your battery won't be fully charged and you can get such an error on your screen. Also, the problem can be in the cables, so if they are not correctly connected to the system and battery they can discharge the battery even when you are not in the car.