No matter how good Cogley might be, Kirk has to be even better.
This may be the heart of the episode's dilemma, the requirements of the series and our expectations of courtroom drama. The show's heroes can't sit passively while the guest star lawyer saves the day. With that in mind, the defense lawyer might have been written as competent and willing, helping the protagonist, but unable to overcome the weight of evidence. Cogley, though, is written as a memorable eccentric character, and is set up as the champion of human values against the dehumanizing machines. In a typical courtroom story, our expectation would be that he will outsmart the other side or come up with some crucial evidence that destroys their case. You think he must have an ace in the hole, because he's not cross examining the witnesses. He also hints at something when he talks to Jamie. But he can't outshine the stars, so after all that set-up, he just rests his case and sits down. Of course that's when Spock comes in with the evidence, and then Cogley gets his speeches about rights and machines. All very righteous, but not really his doing, he's just capitalizing on Spock's fortunate detective work.