i have a simple and good solution for this.
if the shifter innersplines are good,and on the shaft also,
but still you can see /feel tiny freeplay?
take it off and splitted halves where the bolt goes through,
these halves can be grinded a mm wider with a 1 mm thick cuttingdisc.
so the split is a bit wider now, then you can tighten the bolt a bit more .
then it grabs deep and free of play in eachothers splines
did this mod on my both bikes ,never had any issues with shifters come loose