Like Ron said...that's how it happens.
Another thing that causes it is when the bike falls over on the shifter side and it gets pulled hard UP while running: this often bends the fork, too. This is often the "parking lot accident" scenario, after which the [usually new] owner shows up at the shop with this shifting problem.
Your old gears look a little worn, but I am curious about the rusty-looking spots on their inner bearings. Is that really rust? Otherwise, they could be made perfectly serviceable again with APE's help on their dogs (and holes). Mismatched oil holes on the gears are not usually an issue of concern, but mismatched holes on the shafts definitely are. In general, if the gear has inner teeth to the shaft and the shaft has a hole, the gear (and position on the splines) must be made to match. This is general Japanese gearbox design for this era of engines, all brands: sometimes I think a "hidden" vendor in Japan made all of them for the Big Three bikes in those days?
There is a dividing line on the inner bearings, too. Along about the New Factory K3, the inner bushings on many of the gears switched from Oilite dimpled Bronze 841 to cast iron composite (by the "F" bikes only the F0 early ones had bronze at all). This lost power (and life) overall, but was about 10% as expensive, hence the switch. If you have the option in any of them to use the bronze types, go for it. It pays back in top-end power on the road.