The same thing happened to me a few weeks ago. It turns out that my switch was very difficult from the beginning to move. I realized this only when I used another iPhone and noticed that it didn't take much effort to move the switch.
I tried (and failed miserably) to glue the cap back onto the switch. It takes two very very very tiny drops of superglue to put back on, which I found incredibly difficult to do even with very steady hands. Plus, you run the great risk of gluing your switch into place (which is what ultimately happened to me when I tried to fix it myself).
I just went to my nearest Apple store and the genius swapped it out without question. It's been a common enough problem with the switch, and they'll replace it for you. Make sure that you have an appointment scheduled with the genius bar, though, before you go in.
Hope it helps.