If I remember correctly is that after your friend trap u in the illusion world and you escape, you let him go. Like you will get the choice to "stop him"(this ending is were u see his back with the ribbon or something)or "let him go".
I played the game a while ago, hope this give you some clues (; ^-^)