what could cause my gfci to randomly trip?
I suspect the electronic circuitry of the AFCI is drawing some quite small current from hot to ground, which looks like a ground fault to the GFCI. This current is probably not enough to trip the GFCI normally, but when switching an additional load on the protected side of the GFCI, there could be some transient currents from hot to ground that take the GFCI over the trip threshold sometimes Remember, the GFCI is supposed to trip with as little as 5mA of ground fault current.

Try connecting the light and fan to the line (unprotected) side of the GFCI. I don't think code requires the fan and light to be protected by the GFCI in any case, just the receptacle.