Hi Michael, sorry to hear about your loss.
The biggest clue/culprit here from your story is your battery, you mentioned you got battery warning at 40 and 50% on previous flights..
That's tells me that the voltage of your battery is fluctuating more what it should under load/stress while...