It is a paradox classic example, when they went there he had died and that was his grave, but then he managed to remain to die, then his grave in Trenzalore never existed, but for Clara able to save it in special Christmas she'd have saved him jumping on your timeline, creating a paradox.
We are talking about River's grave though not the Dcotor's and his grave still had to exist for Clara to have gone back and changed it. That's only part of that makes no sense. Clara had the Time Lords give the Dcotor a whoe new set of regenerations altering the future, but that meant she didn't get to though the Doctor's timeline to save him in the past.

In short since the Doctor didn't die there he had no grave there for them to visit and Clara could've gone back though his timeline to save him, since the 11th Dcotor didn't there. Then of course there the fact that Smith's Doctor wasn't the 11th Doctor but in fact was the 13th Doctor.
