There are technical/troubleshooting reasons to put the gear handle up with the airplane on the ground.
During those operations, the landing gear is "pinned" so that the landing gear actuators cannot move, even with hydraulic pressure applied.
But if the gear is not pinned correctly, then, well, it can move under hydraulic pressure - and this is the result.