Yo are right that the card leaves play in Step 9. But the response "After a card leaves play" only happens in Step 10, because "being defeated" and "leaving play" is the same for allies, as stated in the rules for LEAVES PLAY, page 25:
LEAVES PL AY
The phrase “leaves play” refers to any time when a card transitions from an in-play area to an out-of-play area. Defeating a character, discarding a card from play, placing a card in the victory display, or removing a card from the game are all different means by which a card can leave play.
Thus, the events "After being defeated" and "After leaving play" are one and the same and should trigger at the same time (Step 10).
Thanks in advance!