Electrical surges, lights flicker/dim them go back to normal
I have had breakers develop high resistance at the hammers ( the connecting device) in some cases if not two much arcing turn all the smaller breakers off, then flip the main breaker on and off 10 times, this can clear the carbon and reseat the hammers on the contact. If it works but starts doing it again after a while the breaker is failing and needs to be replaced. What brand of panel and type of breaker would be my only question in some cases the brand itself may justify replacing the entire panel.