Nope, Federer did himself a big favor by not retiring in 2012 and continuing until 2021-2022.
IFs and BUTs type glorification of yesteryear greats only happens in TTW, in the real world recency bias takes over bigtime. In the real world legacies look different in 10-20 years time, like for example Sampras was head and shoulders ahead of Agassi as a player in 2001 and once he crossed Emerson nobody cares whether he had not won the french or if Agassi had won all 4 slams at least once, but today 20 years later people in their 20s and 30s are saying on social media that Agassi winning all 4 slams at least once is a great feat because the Big 3 also did that and Sampras being the only 1 out of the 5 ATGs in the last 30 years to not do that makes him look inferior and at best on par with Agassi, people who never saw him play don't know that he dominated the 90s or maybe they don't care. SO Agassi's stock has gone up and Sampras's down for the people who never watched them play.
Sameway had Fed retired in 2012, people would have said, ok he left at 31, he was Nadal's pigeon and was a coward to retire early (like Borg) because Novak had also arrived. But in these 9 years Fed earned at least 600M $ in money, won 3 slams after 35, went toe to toe with Djokodal in 5 sets a few times, youngsters have seen the old man play, so they know that he is special and like the Rolex Ad says, his legacy has only grown perpetually.
Otherwise with Both Nadal and Novak on 20 and Fed on 17, it would have looked like Fed was inferior.
So being in the limelight (even if it is at the cost of being called a fraud-error or whatevr nickname that people give him while bashing) if better than being forgotten.
Being bashed is better than being forgotten/irrelevant.