Whenever a legendary permanent other than Yomiji, Who Bars the Way is put into a graveyard from the battlefield, return that card to its owner's hand.
Yomiji’s ability triggers even if Yomiji is going to the graveyard at the same time as the other legendary permanent.
Yomiji’s ability triggers whenever any legendary permanent is put into a graveyard from the battlefield, not just legendary creatures.