I was playing on Magic Online, and the following has happened to me twice: I have Emeria Shepherd in play, and Imprisoned in the Moon in my graveyard. I play a Plains, and use the Shepherd's ability to return Imprisoned in the Moon to the battlefield. The client asks me to choose a target for the aura, and I do (in the first case it was Emrakul, the Promised End, while in the second case it was Archangel Avacyn). In both cases, after choosing my target, my Imprisoned in the Moon immediately goes right back to the graveyard, leaving their creature alone. It's not clear to me why what I'm trying to do doesn't work, and a quick search didn't return any results, so could somebody who knows the rules a little better than I do please explain to me why this happens? Thanks!
The interaction should work, with Imprisoned returning to the battlefield attached to Emrakul or Avacyn and turning either legend into a land.