Actual guilt or innocence aside:

At Bill Cosby's first trial, attorney Brian McMonagle utilized a strategy of trying to make the relationship between Cosby and his accuser appear consensual. In short, a defense of "even if everything she says is true, so what?" This...worked! and resulted in a hung jury.

At Cosby's retrial, attorney Thomas Mesereau elected a more dangerous strategy, trying to make the accuser seem like a gold digger just out for money, as essentially, a liar, whose testimony could not be trusted. Basically, Mesereau called Cosby's accuser a liar. But this strategy backfired, as the judge allowed 5 additional accusers to testify against Cosby about prior bad acts, and it became more and more difficult for Mesereau to convince the jury that all of them were liars.

Granted, part of the reason Cosby was convicted was due to the judge's allowing in the testimony of all of these past accusers (as well as evidence from Cosby's civil lawsuit over this same subject matter, such as his past deposition testimony where he admitted giving Quaa'ludes to women, and the fact of his $3.4M settlement payout in that civil lawsuit, all of which inferred guilt, but given the way the judge was ruling Mesereau should never have elected for a strategy to try to discredit the accusers, given that the judge was allowing not just one but many accusers to testify.

Bad choice! Cosby. Your attorney f'ed up. Should have stuck with McMonagle.

Appeal time!
Will Any Bill Cosby Conviction Withstand an Appeals Court? | Hollywood Reporter