Gas fireplace won't run/turns off when fan switch is in the ON position
So the batteries are only for when the house looses power. The "fan" switch actually cuts all power to the outlets under the fireplace. According to the manual, there is one for the fan, one for the pilot, and one for the REM/AUX.

According to the fan manual, it uses a temperature sensor to control the fan.

The reason the flame cut off when the "fan" switch was turned off, is that the batteries were dead despite having been new when installed last December. Since the batteries were dead, and power to the fireplace's control module was cut, it turned off the flame as a failsafe.