The latest "Transformers: The Last Knight" trailer gives an idea of why Optimus Prime goes rogue in the film. The preview teased the appearance of a Quintesson, who could be the reason why the Autobot turns bad in the sequel.
The other previews saw Optimus beat up Bumblebee in front of Mark Wahlberg's character. The reason for his drastic change of behavior is unknown, although the latest "Transformers: The Last Knight" trailer may have the answer. His creator may have something to do with his evil actions.
The "Transformers: The Last Knight" trailer teased the appearance of a Quintesson.According to Comicbook, there is great chance that these sinister robots are in the movie because it explores the history of the Transformers. Film producer Lorenzo Di Bon confirmed that the sequel looks back on the ancient history of these robots, so it would make sense to include the Quintessons.
The latest "Transformers: The Last Knight" trailer teased the appearance of these ancient robots. Going into the preview, viewers see Optimus talking to a female robot with tentacles. She has features like the Quintessons (see comparison video below). These robots were the creators of the Decepticons and the Autobots. According to Nerd Reactor, they treated the Autobots and Decepticons as slaves. However, they were eventually overthrown when their creations rebelled.
This would explain why Optimus is in chains and the female robot, likely a Quintesson, is judging him. Perhaps Optimus is being mind-controlled by his maker as payment for destroying their home planet. The "Transformers: The Last Knight" trailer shows his eyes turn from blue to purple after he expressed his desire to seek redemption.
It is likely that Optimus goes rogue as part of his redemption. It could be his punishment for rebelling against his creators. The Autobot is not himself in "Transformers: The Last Knight" because a Quintesson is controlling him.