Assuming a light aircraft has direct cable linkage to the rudders, during taking off in a very strong crosswind with the pilot correcting with hard rudder, what keeps the nose wheel from remaining off center and jamming as it retracts?
With the weight off the nose gear after rotation, the strut extends to the unloaded position, and the two internal cams shown on the right mate and center the nose gear.
Centering cams built into the shock strut structure accomplish this. An upper cam is free to mate into a lower cam recess when the gear is fully extended. This aligns the gear for retraction. When weight returns to the wheels after landing, the shock strut is compressed, and the centering cams separate allowing the lower shock strut (piston) to rotate in the upper strut cylinder (FAA).
On a Cessna 172RG this is achieved by the centering block (circled on the left) during retraction. The rudder is still allowed to move through a bungee link.
Kinematics of the system automatically straighten the nose wheel as the landing gear is retracted. During retraction, the centering block on the upper torque link aligns and locks the nose wheel in the neutral position. Continued free movement of the rudder pedals is assured by the steering bungee (Cessna 172RG service manual).