The confusion is easy to understand. Most of us are far more familiar with cars than bikes where problems like this occur. When a car has this exact same problem, it is able to force the two sets of locking, or clutching, lugs physically clear of each other, moving the entire shift linkage with it. Then, the engine revs up and it's truly out of gear.
.First you said it wasn't JUMPING OUT OF GEAR....Just slipping..
Now it is actually jumping out of gear......
A motorcycle with a drum cam shifting setup can't do this because force applied to the fork by the gears cannot rotate the cam, and if the cam doesn't rotate, the fork won't move. So, instead, the gear flexes the fork out of the way far enough that the lugs no longer contact each other or bear any load. The gear is technically now disengaged, "out of gear", and the lugs are standing on top of each other, with the third pinion gear driven by the mainshaft, and the flexed fork pushing them together. When they rotate far enough, the fork will force the lugs on third will drop back into the gaps between those on the 4th pinion, the driving load will be reinstated, and it will push the gears apart once more. This is what "jumping out of gear" is like on a cam shifted bike; not the free revving condition seen in cars, but very much still slipping out of gear as a result of worn parts.
The gear teeth themselves bear no responsibility for this condition. It's the lugs on the sides, and if 4th is at fault, that means that at minimum, the 4th AND third pinion gears, both on the mainshaft, AND the forward shift fork need to be replaced.
As it was pointed out, it's a little difficult to do a decent diagnosis remotely, and we can only go by the info we are given. What you are describing is a pretty classic set of symptoms, but you could still be misdirecting us and yourself. To be a faulty trans, the problem would have to absolutely be isolated to a single gear (usually). It would be load sensitive, meaning that the harder the engine pulls, the more severe the skipping is. A problem with ignition would be more irregular, and less isolated to one gear, and less physically harsh feeling. A clutch problem would not be jerky. Chain problems would be more severe in the lower gears than the high ones. So, it still sounds like a 4th gear problem.
What do you mean by "ring gears"? If you mean the gears that spin freely on the shaft instead of being splined to it, then that is your problem. Each gear speed consists of one gear splined to a shaft, another one turning freely on the other, and a third one splined to the same shaft as the free turning gear that slides over against it to lock it to the shaft. If he failed to replace the free turning member of the 4th gear pair, he left half the problem in your trans.
my mechainc never said he replaced all the ring gears
That's what it looks like to me.