Where's the voltmeter connected?
The ignition light is between the +ve connections of the alternator & battery, it goes out when the alternator produces a voltage close enough to the battery's thus cancelling each other out so that not enough current can flow in either direction through the bulb to light it up.
If it's an intermittent fault & battery & alternator voltages measure within a few volts then it could be there's a short on one side or other of the bulb.