The circuit relies 100% on the microcontroller outputting the right signals, otherwise a mosfet gets stuck on (causing overcurrent, and burning out). Little boxes like that are hard to waterproof and make resistant to repeated temperature fluctuations. My guess is some water went in and shorted some control signals, or repeated temperature changes caused a solder joint to crack. That caused the MOSFETs not to get the right control input, so they got really hot and caught fire.
It's just as likely to happen on a de-energised panel too - the optimizer is still connected, and the sun is still shining.