I always look for the simple things first and you did say you changed the gearbox oil a week ago? What gearbox oil did you put in when you drained it? Could it simply be a slipping clutch when hot?
Totally agree but he said he lost particular gears & was able to ride back to the pits, if the clutch was slipping I would think it would slip in all gears.
But the clutch side is the easiest to get to so start there.
A while ago I did a complete rebuild on a YZ250F & used aftermarket bearings for the gearbox. The clutch shaft bearing had a steel ring around it to provide a mounting point.
Everything went fine with the rebuild, adjusted clutch, internally then externally. Went for a ride and all good till I put it under load. (Running in) The more I pushed it the more the clutch slipped. Strange as new primary drive (Clutch basket), new friction & steel plates, new springs. I found if I adjusted the cable so far off as not to work (When disengaged) it was fine but adjusted up (As per specs) slipped.
Solution, after many a sidecover off, was the ring around the clutch shaft (Aftermarket) bearing (All that holds it in place) was mild steel, compared to hardened steel of the OEM, was flexing (Only about 2-3mm) when I was adjusting it but then the helical (Angled) cut gear on the primary drive would try and "Push" the clutch towards the gearbox under load taking up the gap & this would then push the top plate against the clutch rod thus disengaging the clutch. Took the hardened one off the OEM & put that on, problem fixed. Not saying that is what is wrong here but just proving small things can create big problems.