Those look like the original factory nuts on both shafts. You can see how they came off the assembly line with their nice machine staking marks present on both. Unfortunately, the stake marks barely protruded into the shaft slots which allowed the nuts to loosen with time/miles as you experienced on your F5M33. Here, I suspect someone was in there before you, but only partially addressed this problem. I say that because the nuts are rotated but they are moved in the tightening direction. But they failed to stake them in place too. What you need to do is torque them now to 109 ft-lbs.....the nuts themselves are in great shape. Then use a thick ended slotted screw driver or chistle to stake them down well into the slots.....I do it on both slots and both nuts. On your first image, the gear teeth show moderate wear and deformation suggesting that the nut loosened in the past allowing significant play between those gears. The shifter popping out of, and grinding into, 5th and reverse were my first clues.