I don't see how anyone could rank Ancelotti above Pep. There is literally no argument for it.
The one thing that people use to counter Pep's success is stating that he only ever managed elite clubs with huge resources where he inherited extremely talented players.
Well you can't really use this argument in the case of comparing Ancelotti to Pep because Ancelotti has also only achieved success at elite clubs with huge resources where he already started with an extremely talented core of players. Ancelotti's legacy is entirely based on his stints at Milan and Real Madrid at the time when these two clubs were on the top of their game.
Ancelotti only spend few years of his coaching career in non-elite teams and didn't achieve anything of note there. While he didn't fail there and I don't hold it against him, he didn't do anything in smaller clubs to add to his legacy compared to Pep.
I understand that there is at least an argument to be made when comparing Pep to SAF or even to Klopp and Mourinho, as those managers also achieved success at relatively smaller clubs than the ones Pep managed, so they have something in their legacy that Pep doesn't have.
But Ancelotti literally doesn't have anything over Pep.
Even if you bring up the fact that Ancelotti has won more Champions League titles (5 vs 3), this is simply due to the fact that he managed for longer. Ancelotti has managed for 29 years, Guardiola for 17. Ancelotti has one CL title for every 5.8 years of his managerial career while Pep has won a CL title every 5.6 years. Pound-for-pound, Ancelotti and Pep therefore have similar CL success. Once Pep will have managed for 29 years, there's no way he doesn't have at least 5 CL trophies, unless he goes for international management.
Also when you compare the quality of those CL wins, Pep's teams were far more dominant. Every time Pep won the CL he also won the league, and he has two trebles. Meanwhile Ancelotti failed to win the league more often than not during his CL winning years. In fact he achieved most of his CL wins after he was already out of the title race for weeks, allowing him to rest players.
Where the comparison gets really silly is where you compare domestic league results as Pep absolutely blows Ancelotti out of the water when it comes to this. Ancelotti only won the Serie A one time in his 10 years in Italy. He won 2 La Liga titles in 5 years in Spain. His Premier League title with Chelsea was quality and I give him that, but it was also against a Man Utd that had just lost Cristiano Ronaldo and had already won it three times in a row. A year later United won the league again comfortably and Ancelotti was sacked. While Ancelotti indeed won a league title in every one of the big leagues in Europe, I don't see how winning Ligue 1 with PSG and Bundesliga with Bayern add anything to his legacy that would rival Pep.
Pep has already won twice as many league titles as Ancelotti (12 vs 6). And the way Pep won them was in a totally dominant way, breaking records, competing against some of the best teams in recent history. Ancelotti only won Serie A, Premier League and La Liga when Juve, Man Utd and Barcelona had an off-year, and those clubs resumed their dominance straight afterwards. Well we don't know what will happen next year but if Ancelotti wins the league again with Real, that will literally be the only time he would win back-to-back league titles in his career.
So when you compare the highs of both managers and the trophy haul, Pep is clearly superior to Ancelotti.
And when you compare the lows of both managers, Ancelotti has had much more humiliating failures, it doesn't even compare. I mean Pep basically didn't have any notable failures other than losing some CL knockouts and not winning a league once in a while. Pep's worst seasons are the kind of seasons other elite managers get praised for.
Meanwhile Ancelotti bottled the league with Juventus twice in a row in 2000 and 2001, losing to Roman clubs Lazio and Roma who have no league-winning DNA whatsoever, while he coached the strong Juve team with Zidane. His league form with Milan was lackluster and the club sacrificed league runs for CL. But then he also had some bottle jobs in CL like being crushed 4-0 by Deportivo in 2004 after winning the first round 4-1, and the famous Istanbul final in 2005.
With PSG Ancelotti managed to bottle Ligue 1 to Montpellier in 2012, after taking over at PSG in the winter when it was first in the league and further strengthening the team with elite players Maxwell, Alex and Motta. Such thing does not happen to Guardiola in a million years. There is no possible scenario whatsoever in which Guardiola takes over a PSG team when it's leading the league, adds 3 more elite players and then loses the league to Montepellier of all clubs. This is why such comparions are totally ridiculous. Pep basically doesn't fail, ever. He only has failures if the criteria for failure is literally "not winning everything you can win, every season".
That's just comparing the results of both managers. Then you add the fact that Guardiola revolutionized the game, has had a bigger impact on the way football is played than any manager in the last 20 years, and has been consistently regarded as the best manager around by majority of football years for a decade now.