Insure the loose connection did not get so hot that
it burned the wire or melted the plastic.
If the connectors got super heated, the metal may fatigue and never provide a great connection again.
Replace the pigtail!
Several times mine has done the same thing.
Un-knowingly you will shove the connector back onto the dimmer
and push one of the females back into the connector (it's catch/ holder melted)
Now (if at all) the female may barely grab the male---more getting hot!
I little gob of dielectric grease on the connections helps a lot too!
These pigtail connections can be found at an auto parts store.
My last pic shows a new connector.
Connections up on the light switch can do the same thing!
-----JEEPFELLER