The "healthy user bias" is a well-known phenomenon in this kind of research, and has been studied specifically with vegetarianism (for example,
https://journals.lww.com/nutritiontodayonline/abstract/2019/...). But as mentioned in the comment, I suspect you'd find a similar bias in all sorts of structured diets - the group of people who follow diet X (including sub-groups who follow for health reasons, or moral reasons) will be biased towards being more health conscious.
Again, this doesn't negate the research on "diet X", but it does make coming to a conclusion more complicated.