It usually means that the switch itself is on it's way out.
You can take the connector off the switch, and with a small length of jumper wire connect the center terminal to one of the others temporarily. If every time you do this the lights come on as expected, the wiring is probably fine.
If you do this and there are still some inconsistencies, then you will have to trace the wires to the lights and see if there are any damaged spots.
It's possible too that right out at the headlight connector they are getting old and rusty. They do hang out in one of the worst environments on the vehicle (right up there with the floor mounted dimmer switch getting all that dirt and water and snow melt (aka water!) and mud and gunk and sand and dust and, oh yeah, just getting used and getting old, like switches do.
I've seen quite a few compromised connectors at the lights over the years, but way more switches gone bad.
You'll have to be the detective here though, since you're right there and can see all the little bits and pieces.
But don't hesitate to get a new switch if that's what your search leads to.
Paul