This refers to the 2nd Test between Pakistan and South Africa at Rawalpindi, which was played on 4-8 Feb 2021.
Needing 370 to win, SA made a reasonably good start. Things started going wrong when Markram was dismissed at 241/4. Captain Quinton de Kock came in, and was promptly dismissed first ball by Hasan Ali, becoming one of this bowler’s five victims in the innings and ten in the match.
It must be particularly mortifying for a captain to be dismissed first ball in the 4th innings of a difficult chase. Let us see how many times it has happened.
While the number of balls in an innings have not always been recorded before 2000, we presume that most golden ducks have been recorded.
Golden duck by captain in 4th innings:
This includes all cases (win, loss, tie, draw).

23 such cases ending with Q de Kock. Many prominent captains appear here, such as Sobers, Greg Chappell (twice), Atherton, Ganguly, Inzamam and more recently Kohli and Root.
What if the team won in the chase despite the captain getting a golden duck? See this list:

That was a very short list of two. And they were relatively less prominent captains.
Now see when teams have tied or drawn in the chase when the captain got a golden duck:

5 such instances. The one involving Sobers was not in the second Test which India won, but the 5th one which India came close to winning (thanks partly to Gavaskar’s 124 and 220).
And finally, cases when teams have lost in the chase when the captain got a golden duck:

16 such cases, ending with de Kock. He is in distinguished company, along with his contemporaries Kohli and Root.