IME, intermittent ghost shifting is most commonly caused by dirt or corrosion somewhere on the cable or outer, most likely at the derailler end.
Endlessly fiddling the alignment with the barrel adjust just moves the problem. Replace the cable and outer, ideally with a continuous outer and rust resistant cable.
Is your cassette and freehub snug? Grab the cassette and see if it wiggles. Also jiggle you cranks to see if there is play in the BB. And look very carefully at the hanger (take it off and lay it on a very flat surface to see if it is perfectly flat). All these can cause chain alignment problems.
Good luck