Order 66 just makes more sense and seemed more diabolical and chilling all along when you saw it as an implanted "switch," one that once flipped would turn easygoing, friendly Clones (at least to their Jedi commanders if not their enemies on the battlefield) into determined, brute killers. I understand the argument some make that "it's more interesting from a dramatic standpoint if the Clones receive Order 66 and then question and fight it," but that would be one incredibly unreliable and sloppy piece of programming to introduce into the Grand Army of the Republic. A protocol that you won't even activate for almost a decade and a half and when you do won't be followed by many Clones, who'll rebel and fight the instructions?
Nah, it's just more sinister and makes more logical sense for a loyal commander like Cody who was friends with Obi-Wan for over three years through some of the worst battles of the wars to suddenly have an internal switch flipped and become an angry executioner issuing the order to kill his good friend, comrade-in-arms and commanding general. Otherwise wouldn't he question the Chancellor's order to coldly execute Obi-Wan and even protest? Who wouldn't if they possessed free will and exercised complete control over their decisions in that situation? Some fans might feel it's more dramatic and interesting for half the Clone Army to rebel and refuse their orders from Palpatine, but where does that leave the Jedi Purge and the greater storyline? And what does it say about the Sith Lords and the Kaminoans that the best they could do with their collective intelligence and cunning was a protocol that wouldn't be needed for years and years and then when it was actually activated a lot of Clones wouldn't even bother to follow it?