In Cody's case, he seems to have felt an increasing sense of guilt for what he presumably believed was Obi-Wan's death. He no longer believed orders should be obeyed without question, and instead considered himself responsible for following the orders he had been given.
After years in service to General Obi-Wan Kenobi and working alongside his friend Captain Rex, when Darth Sidious executed Order 66, Cody's loyalty was eclipsed by his clone indoctrination, and he ordered his troops to fire on the Jedi.
Commander Cody's Legends Fate Was Tragic
However, when Palpatine executed Order 66, he couldn't resist the influence of his microchip. So, he ordered his troops to fire and kill Obi-Wan. After Order 66, Cody remained loyal to the Empire.
All season, The Bad Batch has been showing the pangs of regret that some clones feel over actions such as Order 66 and the destruction on Kamino.
As for Commander Cody, many would have been surprised that he was loyal to the empire. He served under a good Jedi general and was friends with Ahsoka, Captain Rex, Anakin, and others. During all of that time, he was loyal to the republic.
When Emperor Palpatine initiated Order 66 in Star Wars: Episode III - Revenge of the Sith, Commander Cody was among the clone troopers that turned against their Jedi compatriots — but he survived long after betraying Obi-Wan Kenobi.
They were often assigned to the same special operations missions, from rescuing a Jedi in an enemy prison to locating a traitor among their own ranks. Cody, though he outranked Rex, trusted in the captain's abilities, and placed him in charge on many occasions.
Ahsoka was with the 501st legion whereas Cody was in the 212th. The two of them were both commanders, however Ahsoka had an upper edge. She was a Jedi Padawan, meaning she outranked any clone trooper. So technically, if Cody was in her legion, he would follow her orders.
Due to Skirata's influence and support for Darman, Omega Squad refused to follow Order 66. Another clone commando group, Yayax Squad, had a smaller role in the Republic Commando novels, and like Omega Squad, these clones disobeyed Order 66. Cov, the leader of Yayax Squad, was in love with Kal Skirata's daughter.
Age of the Empire
During the subsequent Imperial Era, Cody and the 212th, by then serving as stormtroopers, assisted in the Empire's final enslavement of the Wookiee homeworld of Kashyyyk.
It also suggests that Cody knew he and his men could never take out General Kenobi, meaning that even then, the clone commander realized Obi-Wan would survive — that also explains why he didn't send any soldiers to confirm Kenobi was actually dead and not just enjoying a nice swim.
Although Fives was killed before he could expose the conspiracy behind the inhibitor chips, his actions impacted the execution of Order 66. At least two clones—CC-3636 "Wolffe," and CC-5576-39 "Gregor"—removed their chips at some point either before or after the activation of the Order.
Commander Cody, originally known as CC-2224, serves directly under Jedi General Obi-Wan Kenobi during the Clone Wars.
A disillusioned clone trooper who saw too many of his fellow brothers die in combat, Cut Lawquane left the service. The deserter attempted to carve a new life for himself as a simple farmer on Saleucami, wanting only to live in peace with his wife Suu and their children, Jek and Shaeeah.
Jedi High General Obi-Wan Kenobi and Commander Cody lead the 212th Attack Battalion while Anakin Skywalker and Captain Rex lead the 501st Legion.
As far as you know, Obi-Wan and Cody were very close friends, as were Anakin and Rex. But Order 66 severed this friendship. However, even after a time when the inhibitor chip stopped having an effect on clone troopers, I didn't see Cody ever mention Obi-Wan, or conversely, Obi-Wan would mention Cody.
He viewed military service as an honor, and his loyalty to the Republic and his Jedi Generals was absolute. But when Order 66 was executed, it was Ahsoka who helped to free Rex from the programming of his inhibitor chip.
Clone marshal commanders were the highest rank a clone trooper could gain within the Grand Army of the Republic.
Commander Cody is one of the Star Wars franchise's first named clone trooper characters, and in addition to playing a supporting role in Star Wars: Episode III – Revenge of the Sith, he also appears frequently in the seven-season run of Star Wars: The Clone Wars, which depicts his close friendship with General Obi-Wan ...
❔ [Clones] Where did Cody get his scar? One of the most iconic things about Cody, apart from his helmet and armour markings, is the scar on the side of his head.
It was Barriss herself who orchestrated the bombing and framed Ahsoka. Anakin dueled Barriss on Coruscant, and eventually placed her under arrest. Brought before a military tribunal led by Governor Tarkin, she admitted her guilt, but held steadfast in her belief that the Jedi and Republic had lost their way.
He was a good friend and a moral person, who looks out for others and always tries to do the right thing. None of that would stop the implant in his brain from carrying out a shocking act of betrayal. And unlike his compatriot Captain Rex, he wasn't able to remove his chip.
However, when Palpatine announced Order 66, Cody immediately began moving his forces against Obi-Wan Kenobi.