A situation regarding AVR and bad power grid voltage
I suspect that both are wrong. The system that controls the transfer should be designed to prevent repeated activation and de-activation of the transfer switch. Once a transfer from the grid to the DG is initiated the load should remain connected to the DG for long enough after grid power is restored to assure that grid power is stable.

There is also the possibility that the AVR card is not sufficiently robust. I doubt that the card failed due to insufficient maintenance or card age. I would investigate the card age and the maintenance recommendations of the manufacturer.