Legacy? well, since you used that word...
Sparky Anderson lost 104 games in 1989 and was well under .500 the last seven years he managed...He's in the Hall of Fame for the Big Red Machine and then taking Detroit to the 1984 Championship. That's his legacy. No one outside of a few bitter nuts look back at the late 1980s and say, "Sparky? He wasn't so great."
How about Adolph Rupp? His last championship was 15 years before he retired.
No one remembers Babe Ruth for his bloated final years with the Boston Braves. No one remembers the dreck Hemingway wrote after "Old Man in the Sea" or the paper cutouts Matisse messed around with in his last years, or really any of the last 15 or so albums by Miles Davis or anything the Rolling Stones did after Exile on Main Street in 1972 , and on and on.
A legacy is established by what you do at the height of your powers that separates you from the commonplace and that helps define an era; a place and time.
If Calipari doesn't turn things around at Kentucky next year, his legacy will be building Massachusetts from nothing to a Final Four program, taking Memphis to the Final Game, and coming to Kentucky when the program was in shambles and between 2010 and 2019 winning a championship, going to four Final Fours and seven Elite Eights. He'll be remembered as the guy who first recognized the potential in the NBA's new rule making kids wait until they turned 19 to be drafted, and turning that into a great run at Kentucky. Sure, like with Dean Smith and others there will be the shadow over that -- he should have won more championships. But his legacy is secure.
Sorry to disappoint those filled with anger and hatred right now because of the disappointments of the past few years, but his legacy is about as solid as it gets.