You most likely have a bad contact somewhere, creating a resistance. It gets warm under use, the metal changes shape, the contact opens, and out go the lights. Leave it all to cool down, the metal returns to its original form, and the lights come back on.
When you have a contact that's bad because it has a resistance, the contact's temperature will go up under use, which makes the resistance go up, which makes the contact's temperature go up, which...
It might be a badly soldered joint.