The reason Wahlberg’s character is partnered with Ferrell’s - After committing an act that is sacrilegious to any true blue New Yorker, Wahlberg’s character Terry Hoitz is exiled to a desk job. It’s a great gag that keeps on giving throughout the film.
Mark Wahlberg - Ferrell is the comedian, so you expect him to be funny. And as buttoned-down forensic account Detective Allen Gamble, he doesn’t disappoint. But, in my opinion, Wahlberg gets the biggest laughs in the movie as the hot-headed Hoitz. His reactions to Ferrell’s reserved goody two-shoes Gamble are hilarious. Then there are the his backstory bits -- the reason he knows how to dance and play the harp, the pleasure he takes in directing traffic, his peacock speech -- they all are very funny.