Ben Stokes hung his head in shame as he chipped a wide half-volley to extra cover gifting South Africa his wicket in the second Test in Cape Town.