It was right there. Faf du Plessis' first Test double-ton was just over Dimuth Karunaratne's head. He could see it when he tried to hit Wanindu Hasaranga over the top for the money shot that would have taken him to 200.

So he stepped forward and struck the ball and may have already imagined it clearing Karunaratne, bouncing a couple of times until it bobbled over the boundary, at which point he would have stretched out his arms, taken off his helmet and soaked in the satisfaction.

But no… du Plessis had put a foot wrong, for only the second time in his innings. The first was 21 deliveries earlier when he raised his back foot as Niroshan Dickwella attempted a stumping. A review could not conclusively prove whether his foot was sufficiently off the floor at the moment the bail lifted and he was afforded the benefit of the doubt. He was on 191 at the time and quietly worked his way in ones and twos to 199, and the moment of presumed glory. When it came, he moved down the track, but didn't get to the pitch of the ball. The catch was simple and the result, for the South African change-room, stunning.

Dean Elgar, who is also among the small club of batsmen to be dismissed on 199, sat with his head cradled in his arms. Mark Boucher rocked back in his chair and shook his head. Quinton de Kock covered his mouth with his hands. Morne Morkel, who grew up on this ground and called du Plessis getting a double on social media shortly after he reached his hundred, may have shuddered from his new home in Australia. And du Plessis gritted his teeth and glanced at where Karunaratne had taken his 200 from him before walking back a warm applause from almost everyone the stadium, the Sri Lankan fielders included.

There isn't much use ruing what could have been, except for that there may not be a better opportunity for du Plessis. This was the day that South Africa put up the highest score at SuperSport Park, established two new partnership records against Sri Lanka, for the fifth and seventh wickets, had two other batsmen secure career bests and were facing an opposition that, at one stage, had only two bowlers at their disposal.

No disrespect to Sri Lanka - in fact only sympathy because bad luck and maybe enforced bad planning as a result of the pandemic left them severely depleted - but the quality of their bowling was compromised. Suranga Lakmal was ruled out of this match, and Kasun Rajitha and Lahiru Kumara could only play limited roles, leaving it to Vishwa Fernando to carry the pace-bowling load.

Maybe that's what it needed for South Africa to start to rediscover their batting rhythms. After Aiden Markram and Elgar translated their domestic form onto the international stage once again, Temba Bavuma broke a 14-innings half-century drought (and probably should have gone on to break his soon-to-be-five-year century drought but walked) and du Plessis, who has not played a game of red-ball cricket since he stepped down as Test captain in January, showed why South Africa can be damn grateful he didn't retire as well.

That du Plessis still has it we knew that from the recent IPL, as well as the subsequent T20 series against England. He seemed to have lost it a little in Tests, though. In 14 innings since the 2018-19 series against Sri Lanka, he had scored two half-centuries and, in the last 11, failed to cross 36. But he had other things on his mind.

Series in India and at home to England - his last as captain - came and went amid a turnover of coaching staff. He also became embroiled in a race controversy after using the controversial phrase "we don't see colour" when explaining why Bavuma had been dropped. While that may sound benign, in South Africa, where colour has been definitive in deciding opportunity for centuries, it was a naive and careless statement to throw out and it haunted du Plessis. He struggled for runs, he struggled for consistency and in the end, it seemed he was struggling to justify why he was putting himself through it all.

Becoming a daddy can make a big difference to someone's priorities and character, and maybe scoring daddy-hundreds could do that too

He stood down and stepped away, which seems to have done him as much good as it has others who have relinquished the captaincy. Look no further than the last South African to score a double-hundred - Hashim Amla in the New Year's Test against England in 2015-16. Amla was still the captain in that game but had already decided he was going to resign and his breezy innings was a demonstration in being unburdened. After that match, Amla spoke freely for the first time about the difficulties of being a player of colour in a largely white team in the early 2000s. Letting go of the leadership seemed to liberate Amla, and it may do the same for du Plessis.

Before this innings, du Plessis had nine Test hundreds to his name, all of them under 150. Of all the things he has done in whites, which include leading South Africa to series wins against Australia home and away, daddy-hundreds eluded him.

But just a few months ago, du Plessis became a father for the second time. When his first daughter, Amelie, was born, he spoke about how having a child changed him. With his second, Zoey, there has also been a profound impact with his wife Imari describing their youngest child as the "woman who can command him". Becoming a daddy can make a big difference to someone's priorities and character, and maybe scoring daddy-hundreds could do that too. Supposedly, they are the hallmark of a great player, rather than just a good one.

If there's one thing South Africa need now, it's greats. They have lost their golden generation that lifted the Test mace in 2012 and are in a process of rebuilding. Going into this match none of their batsmen averaged over 40 and their seam attack had just 12 caps between them. They are favourites to win this match, but there is still much work to be done.

Some of that work is the ushering of younger batsmen through the rigours of international cricket. du Plessis shared in significant partnerships with Bavuma, Wiaan Mulder and Keshav Maharaj. Even if he didn't say much, by watching du Plessis and feeding off him, all three would have learnt a little more about what it takes to perform at this level. In that, du Plessis is doing more than just enhancing his reputation in the twilight of his career, he is doing the job of mentoring the next generation, which will be worth more to South Africa than the difference between 199 and a double-hundred.

Firdose Moonda is ESPNcricinfo's South Africa correspondent