I don't personally object to that. As I've said before, Optimus Prime is the only Transformer who's undergone any characterisation, and it was in Age of Extinction. He went on a journey of rediscovering lost faith and hope. But it's a shame that we had to wait four movies before we ever saw any characterisation, and even then, it was frequently interrupted by other stuff. It didn't feel like the characterisation was driving the story, but rather, the story drove his characterisation.
That's fine, and I agree, but even if we look at Optimus Prime purely in the context of the movieverse, we can still find gross inconsistency in the first 3 movies. TF1 Optimus Prime avoided needless killing, but in ROTF and DOTM, for no reason that is apparent to the audience, Optimus Prime makes a dramatic shift in his moral principles and executes Demolishor and Sentinel Prime when they were utterly defeated and powerless to fight back. If a person did this, we would consider it to be an act of terror or a war crime.
Imagine if the films were a table-top role playing game. In the first film, Optimus Prime was Lawful Good, but then in Revenge of the Fallen and Dark of the Moon, he's switched to - what may be best described as - Lawful Evil. If a player suddenly did that with his/her character, the Game Master would make him/her make a Save Roll against Insanity.
Optimus Prime: "I put my gun to Demolishor's head and shoot." <rolls.die>
GM: "Demolishor is dead."
Demolishor: "Whatever. I gotta go to the toilet."
GM: "Optimus Prime, show me your character sheet."
Optimus Prime: "Sure."
GM: "Now roll 1D20."
Optimus Prime: "Why?"
GM: "Because it says here that your character is Lawful Good, and you just executed a Decepticon prisoner of war."
Optimus Prime: "But he was a Decepticon! He was killing people in Shanghai!"
Demolishor: "Only 'cos I was trying to run away from you and your mob! I was hiding and minding my own business! Oh... hey Graham, you got any more toilet paper?"
GM: <shouting.over.his.shoulder> "LOOK IN THE CABINET UNDER THE SINK!" <turning.back.to.Optimus.Prime> "It doesn't matter, Pete. At the time that you shot him, Demolishor was a defeated and helpless opponent. He was a P.O.W. and you killed him. Now make that save roll!"
Optimus Prime: "That's bull-spit!" <rolls 9> "What?!"
GM: "You've failed your save roll. Your alignment is now Lawful Evil, and..." <rolls.die> "...you have a phobia towards untying knots."
Optimus Prime: "...oh... that's... not too bad an insanity. It's not like I'd ever end up being suspended upside down in the air by cables or something!"
<door.opens>
Shockwave: "Hey guys, I'm back with our pizza orders!"