@Devinism said: "On the inside of the switch that lever closes a contact that sends the ground signal from "D" to
the metal case of the headlight switch (which is grounded to your dash, when installed). When that happens (in theory, at least) the ground circuit is now complete for your dome light.
You need to ensure that this ground is in place. This and that toasty looking terminal are where I believe the issue may lie. No ground, the power will want to flow to the next available ground, which in this case may well be through the yellow grounded dome/door light wires, through the rheostat and D terminal stop.
The ground may be functioning when things are cool, but when it heats up, perhaps it pulls away from where it grounds somehow, and then the problem rears its ugly head.