I need to mention 3 things- grounds, grounds and grounds.
The switch housing needs a good ground for the pilot light to work. Lights need a good ground to body. Body needs a good ground to frame. Frame needs a good ground to battery. Bed was grounded through the mounting bolts from the factory. Those grounds have probably deteriorated. A strap from frame to bed will insure a good ground. Make sure the light housings have a good ground to bed.