What are you talking about? You know that Magadascar is a CGI film, right? There hasn't been one CGI movie that didn't do well. There have been PLENTY of animated films that didn't do well, but those were drawn by hand.
Every CGI movie and how well they did:
Robots - $125,614,860
The Polar Express - $162,753,127
The Incredibles - $261,437,578
Shark Tale - $161,412,000
Shrek 2 - $436,721,703
Finding Nemo - $339,714,367
Ice Age - $176,387,405
Monsters Inc - $255,870,172
Shrek - $267,652,016
Dinosaur - $137,748,063
Toy Story 2 - $245,823,397
A Bug's Life - $162,798,565
Antz - $90,757,863
That is because the studio marketed it as a drama and fans don't seem to buy him as a serious actor. So you can't count that as a comedy that didn't do well.
Out of all of the comedies that he stared in since the Wedding Singer, when he became a draw, only 1 out of 7 didn't do well. I don't think 8 Crazy Nights counts because it was a cartoon. It isn't the same thing.
Basically, when Sandler does comedies, they do well. He is draw when it comes to that.