Since you've checked everything on both sides, I think it's a problem with the gears and shift forks.
If the fork or forks that control those gears are bent or sufficiently worn, you might have a case of insufficient lateral engagement of the "dogs" on the sides of the gears. This leads to rounding of the edges of the dogs which causes the dogs to ramp out of engagement and skip over each other thus making that terrible noise.
Unknowingly resting ones foot on the shift lever could place a constant side load on the shift fork wearing it to be too thin and become loose in the fork groove on the gear. Just one possible cause.
Hate to say it, but, me thinks you have to split the cases and have a look.
Go to YouTube and find Kevin Cameron How a motorcycle gearbox works (https://youtu.be/6XZqnkhgFBY
) and what causes poor shifting (https://youtu.be/6XZqnkhgFBY
). These will give you a better understanding if you don't already know these things.
Hope this helps .... Leon