I swear some editor must be telling Oda all the excuses fans make for Yamato not leaving, and then Oda specifically writes it out in a chapter. Yamato knows too much? The relevant pages were burned. Yamato the guardian of Wano? There's a dire threat and Momo specifically asks her not to help so she can leave with Luffy. It can't be coincidence.
Then again, maybe it's all "subversive affirmation".