A couple of possibilities come to mind.

The wires from the light switch could be going to the gauges rather than to the lights for the gauges.

The gauges are low current devices and have a good enough ground when the lights are off, but not good enough for the added current of the lights. The gauges could be grounded through the light filaments, which would dissappear when the light were on.