In season 9, episode 4 (or story 2 part 2) Before The Flood, The Doctor tells Clara that he is going to die.
CLARA: No. You can change things.
DOCTOR: I can't. Even the tiniest change, the ramifications could be catastrophic. It could spread carnage and chaos across the universe like ripples on a pond. Oh, well, I've had a good innings. (to O'Donnell) This regeneration, it's a bit of a clerical error anyway. (to Clara) I've got to go sometime.
Season 9 Episode 4: Before the Flood. Transcript from Chakoteya.net.
What does the Doctor mean when he says "It's a clerical error" in regards to regeneration.