A clear way of seeing this is to consider the doors, which, in the frame of the garage, close for the brief period that the ladder is fully inside. We now look at these events in the frame of the ladder. The first event is the front of the ladder approaching the exit door of the garage. The door closes, and then opens again to let the front of the ladder pass through. At a later time, the back of the ladder passes through the entrance door, which closes and then opens. We see that, as simultaneity is relative, the two doors did not need to be shut at the same time, and the ladder did not need to fit inside the garage.