0
Pretty much any actor has a desire to stretch out beyond the limiting roles that make him famous. Some are more successful at it than others. Though Carrey's forays into more serious roles has not led to box office glory, he has managed to get some serious critical acclaim, and he's putting performances on film that he's obviously proud of.
He can't be Ace Ventura forever, nor does he want to be. His career would likely be worse off if he just continued to put out the same films over and over again (and Me, Myself and Irene was a sort-of return to that style of film that made him famous) rather than stretching his acting vocabulary and showing what he can do as Truman Burbank or Andy Kaufman or whoever.
One could level the same criticism that you have against Jim Carrey against Tom Hanks back in the early 90s. Hanks had been mostly making movies like The Man With One Red Shoe and Dragnet and the like, all comedies where he played essentially the same wacky guy. Even Big or Nothing in Common were not far removed from the same guy he always played.
In 1990, he stretched a little and starred in Bonfire of the Vanities. It flopped (both critically and commercially), and Hanks could've gone back to just doing the wacky guy thing some more. Instead, he stretched even further with Philadelphia and then into Forrest Gump and Apollo 13 and Saving Private Ryan and The Green Mile and now Cast Away. All very different roles than what Tom Hanks was known for in the '80s. Stretching his abilities as an actor has worked out for him, and I hope it eventually does the same for Jim Carrey.
But that's just my theory.