Fuel dye has nothing to do with it.
The fuel sender in light airplanes is usually an automotive-style float operated potentiometer, a rotary variable resistor, like a volume knob on a radio. Inside is an arm, or wiper, that sweeps around a resistive conductor in an arc, providing a variable output voltage for the fuel gauge. There will be a voltage range for the potentiometer output to the gauge with 28 vdc going in, say, 22 vdc for full, and 4 vdc or less for empty. The low fuel light will be set to come on when the voltage is some margin above that, say, 8 vdc or less or something like that.
Sometimes the resistance element inside the pot is a kind of circular wire coil on a card, sometimes it's a resistive coating on a flat surface. If part of the resistor is worn to the point where there is an open circuit when the wiper passes the worn spot, the voltage going to the fuel gauge drops to zero, until the arm moves off the worn spot and the voltage is picked up again.
The low fuel light coming on plus the gauge dropping to zero suggests that the voltage signal is dropping out upstream of the fuel gauge and sensing circuit for the low fuel light. Could be due to a worn spot in the pot as the float moves when fuel sloshes around in the tank, or it could be an intermittent open in the wiring. If the problem goes away when the fuel level drops to some lower amount where the potentiometer no longer contacts the worn spot, that would tend to confirm that possibility.
If I was the mechanic I'd try to duplicate the fault by sticking something in the tank that can move the float up and down and observe the result. If everything works normally, it's more likely to be a loose connection somewhere giving an intermittent open circuit. Check wiring, and if ok swap out the level sender and see if the problem goes away.