If it has been jumping out of gear a lot, or for a long time, there could well be damage to the two selector rods in the gearbox lid. The recesses designed to accept the détente mechanism become worn which can prevent positive location and lead to gears not being correctly selected.
B…..