Reading an answer to this question piqued my curiosity. Has there ever been an instance of an airliner's landing gear collapsing while loading/unloading passengers?
I do not include after emergency landings, but just while "sitting at the gate."
There have been quite a few incidents. Here's one,
Google will find others.
I can't find links, but do know that there have been incidents caused by different issues such as ground locks not in place, failed struts, WoW logic failures and so on where when hydraulic power was applied, the gear retracted or collapsed.
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.
Not so much in Airliners, but I have seen the result with a GA Aircraft when the pilot was demonstrating to a student (type endorsement) how the squat switch works. Well, squat switch wasn't working, and the gear retracted.. Not pretty..
For reference, a squat switch is attached the the landing gear, and detects when there is pressure on the landing gear (as if there is pressure on the gear, it must be on the ground). If the switch detects pressure, the gear won't retract regardless of the Gear Selector position.