This is how Alternate Ending: Twilight becomes Thunderwing's apprentice goes in A Canterlot Wedding.
[Twilight looks at the defeated body of Midnight]
Thunderwing: Yes. Kill him. He was weak, broken. Kill him and you can take your rightful place at my side.
Shining Armor: No!
[Shining Armor goes to stop Thunderwing from persuading his sister to kill Midnight but is knocked aside by the Unicron follower and Thunderwing blasts him with lightning]
Princess Cadance: [to Twilight] Help him!
[Twilight looks at Thunderwing blasting Shining Armor with lightning then looks at Midnight getting back up and ready to fight. Twilight then thinks about what Shining Armor said to her.]
Shining Armor: (voice) She's been completely stressed out because it's really important to her that our big day be perfect! Something that obviously wasn't important to you! Now if you'll excuse me, I have to go and comfort my bride. And you can forget about being my best mare. In fact, if I were you, I wouldn't show up to the wedding at all.
[Twilight then decides to kill Midnight]
[Twilight and Midnight fight. After a long time, Twilight manages to kill Midnight. Twilight then walks up to Thunderwing.]
Thunderwing: Excellent. Midnight was a broken shadow of his former self. I knew that one day, you would replace him. You have just one final test. [points to the Mane Five, Princess Celestia, Princess Cadance, and Shining Armor] Destroy your ties to these weaklings and at last you will be a follower of Unicron.
[Twilight nods and readies her magic and is about to do as she's told]
Thunderwing: Do it. They betrayed you. Do it and you'll finally be a follower of Unicron the Destroyer.
[Twilight nods and fires at Thunderwing, who blocks it]
Thunderwing: You have betrayed your brother and Optimus both. I knew that you would betray me as well. And now... You have doomed yourself and your friends!
Twilight Sparkle: No. No!
Thunderwing: You had such promise. You could have been my successor. My equal. But, now. I may have some small use for you. I still got enemies to find and destroy. You will do my bidding until I find a new apprentice. And then, like Midnight.... You will be cast aside.