Kwired has hit the nail on the head. What you are experiencing is a type of "inductive kickback".
The same situation happened to me a few months ago. A homeowner's GFCI receptacles in their garage would "trip" everytime he turned OFF his garage lighting, which was fluorescent lighting.
They called me to find out why. I found that the electrician had extended the receptacle circuit to the garage lighting. (No problem with that.) But apparently when the transformers in the fluorescent lighting were de-energized, there was an inbalance in the current and this results in a GFCI tripping. And by the way, this was a $20 name brand GFCI receptacle.
My solution was to by-pass the GFCI and have the lighting fed directly by the circuit breaker and the switch.
My advice is for you to do the same for this bath fan if allowed. In my interpretation, bath fans do not need to be GFCI protected unless the manufacturer says they do.