When the slave executes the first Format_description event that the master
logged just after a master restart, the slave deletes all active temporary
tables. The logic is that in case of master crash before the restart, those
temporary tables would have been silently discarded on the master but still
present on the slave, so the delete on the slave is needed to not accumulate
garbage temporary tables over time.
But this causes an error in GTID mode. In GTID mode, when slave connects, the
master scans its binlog from the start looking for the GTID position to start
at, and during the scan, it sends any Format_description event it encounters
to the slave.
Thus, if the slave threads stop in the middle of some updates using temporary
tables, then are restarted, the slave will again receive the
Format_description event at the start of the current binlog on the master. If
the master has not done a binlog rotate yet since restart, that execution will
kill all temporary tables on the slave, causing subsequent events using those
temporary tables to fail.