Have landing gear collapsed at the gate?
A good landing gear design locks it into the extended position under the aircraft's weight. This makes it physically impossible to retract it at the gate, but when the switch is in the wrong position the gear starts to retract during liftoff, when the wings take over the duty of carrying the weight.

This doesn't mean that careless operation or maintenance procedures can't make it retract, however. When the aircraft is poorly balanced, say during loading and unloading, the weight on the nose gear might not suffice to lock it, so a wrong switch position can cause an unintended retraction.