GFCI work by counting the number of electrons that come into the circuit and leave the circuit. The numbers need to be approximately equal. If the numbers coming in begin to exceed the number of electrons leaving the GFCI assumes that there is a ground fault (electrons leaving the circuit through a ground connection such as a person connected to ground).
So, sometimes when the power drops a little it can mess around with the GCFI’s ability to keep track of electrons coming and going and thus resulting in a false trip.
I had four of them in my fish room at one time. One of them would make false trips whenever the power flickered (which was sometimes on very hot sunny days). I simply replaced it with a new GFCI switch and the problem was solved. None of the other three GFCI’s experienced false trips during the power dips.
I suggest you simply replace the faulty switch with a new one.