Dome light issues

I wondered that but they work as they should when the socket isn't screwed in and grounded.... Door switches operate dome light as expected, as does the courtesy switch on light switch. I will order new ones as these have some rust.

Because like @Oldmanmopar said the power to the dome light is constant. The bulb is turned on and off by applying or removing the ground, through the courtesy circuit in the HL switch or the door switches. One wire is for the pwr, one is for the grnd. On cars (don't know about trucks) right at the light they're both black. Further down stream they're usually yellow and pink.