Perhaps you already know this much, but I think the bulb is 'comparing' the voltage from the charging system with the voltage of the battery.
More accurately, it compares the voltage from the generator at the control box, to the voltage from the ignition switch. Normally those two voltages are the same whenever the cutout relay (inside the control box) is closed, since the cutout relay links the generator output (D terminal) to the wire that runs to the headlight switch and ignition switch (A1 terminal). But, if there is a bad connection along the way, or the ignition switch has a high internal resistance, then there might be some voltage difference between the two points.
At least in theory, if the ammeter is showing charge, then the light should be off, regardless of loose fan belt, weak generator, etc. If you are seeing both charge on the ammeter, and the light glowing at the same time, then there must be a problem in the wiring or switch.
I would start by trying to duplicate the situation, and check the voltage at the control box between the 'D' and 'A' terminals, then again between 'D' and 'A1'. There should be no more than 0.3 volts difference there (which obviously isn't enough to light the lamp). If that looks OK, connect a clip lead to the output terminal of the ignition switch under the dash (or the hot terminal of the starter pushbutton will do if it is easier) and compare that to the voltage at the A1 terminal. Again, should be no more than a few tenths of a volt (less than 0.5).
If all that looks good, then likely the light is coming from somewhere else (as John suggested), or there is a problem with the wiring to the lamp itself.
Note that, under the dash, the NU wire should go first to the headlight switch and then have a fairly heavy gauge jumper over to the ignition switch. In the past, I've had a lot of trouble with that connection at the headlight switch; apparently the wires vibrate and over time the individual strands work-harden and break.
PS, I'm assuming this is a TR3/A/B, and you have already verified that the ammeter is reading the proper direction. It's a good idea to mention which car you are working on whenever you start a new thread, since they aren't all the same (and I find it hard to keep track of who owns what). Or just put it in your forum signature.