After Time Lords are gone, Wilfred is locked in the control room. The Doctor hears four knocks coming from Wilfred who is knocking on the door. Doctor was sure that he will die forever after being exposed to radiation in rescuing Wilfred. Before he was exposed to radiation he said "I'm gonna die after this" to Wilfred, but he didn't. He regenerated slowly. Why didn't he die despite the TARDIS not being there? Or why did he regenerate so slowly? Does it mean the prophecy was wrong?
There are only two possible reasons why the Tenth Doctor said, or implied that he was going to die from the radiation incident (although he didn't actually say "I'm gonna die after this" as you stated, but he did infer it)
I could do so much more. So much more! But this is what I get. My reward. And it's not fair! Oh. Oh. I've lived too long.
i) He thought he might die
The Doctor - or any Time Lord - can regenerate, but that does not mean they are invincible, or cannot be killed. The Master has tried to kill the Doctor many times, and he would know better than anyone if that were not possible. If the Sontarans were to dissolve him in acid, there'd be no coming back from that. So, the first possible reason for the Doctor saying this is that he genuinely thought that he might die from the incident... but then regenerated after all.
ii) He equated regeneration with dying
The second possible reason is that the Tenth Doctor (like some other incarnations, we have since seen) did not want to change. On one occasion, the Tenth Doctor 'wasted' a regeneration in order to heal himself and stay the same, resulting in the creation of the 'meta crisis Doctor', and which the Eleventh Doctor later described as "vanity issues". And of course, at the point of his regeneration, Ten declared "I don't want to go". It would seem that a personality trait of Ten was that he liked who he was and did not want to regenerate - to him, regeneration was like dying. So, perhaps he knew he would regenerate, but still felt like that was akin to dying.
Your point about "the TARDIS not being there" didn't make much sense to me - the TARDIS has no part in the Doctor's regeneration. Regeneration is an inherent ability of Time Lords. Of the 14 regenerations seen on-screen (including the War Doctor and Ten's 'wasted' regeneration), only 8 have occurred inside the TARDIS, and one of those - Ten's final regeneration - began outside it. The rest occurred elsewhere, mostly away from the TARDIS. We've also seen the regeneration of other Time Lords in other places.
Why did he regenerate slowly? That isn't definitively answered in the show, but it might be due to the nature of his death. A Time Lord doesn't die and then come back to life (that would be 'resurrection', not 'regeneration'). They regenerate at the point of death. When the Doctor has died abruptly, such as when Four fell from a height, or when Ten was shot by a Dalek, they regenerate pretty much straight away. But when Nine absorbed the energy from the Time Vortex, he also died slowly and had time to wait for Rose to wake up and talk to her before he finally regenerated, during which time there were signs of regeneration energy upon his person. Nine said that "all the cells in my body are dying", suggesting a slow death. Ten's final regeneration was similar - he absorbed radiation, which evidently killed him slowly until he finally regenerated.
The prophecy was not "wrong" - this has been answered elsewhere on the site, in greater detail. The prophecy said that, before Ten died, someone unidentified would "knock four times". The prophecy could have referred to the Master's "rhythm of four", or Wilf's knocking on the door, or both (actually Wilf knocked more than four times). But either way, the prophecy could still refer to Ten's 'death' as being the end of that life, just as "the fall of the Eleventh" referred to the Eleventh Doctor.
The question mentions a prophecy about the Doctor's death. If an actual prophecy was made, there seem to be two possible explanations why the Doctor didn't die.
- In a hard science fiction story, as opposed to a fantasy story, a prophecy should be expected to be false, either a deliberate lie or a sincere but misguided belief in the ability to see the future. Itis scientically impossible for a prophecy to be accurate, and no prophecy can be fulfilled except by coincidence.
On the other hand a prediction based on exrapolation from evidence can have have a high probability of accuracy (one example, I was walking and suddendly realized that a moving car was about to hit the side of a car waiting for the light to change. A split second later, it did hit the other car.).
Of course Doctor Who is very soft science fiction, quite close to fantasy, and so maybe some prophecies can come true in Doctor Who.
- The TV Tropes trope "Exact Words" seems relevant.
And so if someone made an actual prophecy about the Doctor's death, the exact words of that prophecy should be examined.
If, for example, it is prophesized that the Doctor will die "when" someone knocks 4 times on the door, that can mean that the Doctor will die sometime when the Tardis is parked at, or travelling thorugh, the same moment of outside time that the person knocks, even though the Doctor might live for thousands of years of his personal life and experience after that person knocks 4 times.
And if the prophecy says the Doctor will die 'after" someone knocks for times on the door, that means that the Doctor can't die until someon knocks four times on the door, and will die an unspecified amount of time "after" they knock four times. An unspecified time can be seconds or millennia.
I don't remember seeing any episodes with such a prophecy but I haven't seen them all. If such a prophecy was made, the exact words, and the range of possible meanings of them, are vital to understand it.
The Prophecy mentioned by several people was in Planet of the Dead, where bus passenger (and borderline psychic) Carmen says "Your song is ending soon", mirroring something that Ood Sigma said to him.
"It is returning. It is returning through the dark, and then Doctor...oh but then... he will knock four times."
The Doctor took it to mean that the "it" that was returning was what would cause his demise. So when everything was resolved and he was just fine, he thought he'd dodged fate...until Wilf knock on the door of the radiation booth thingy...four times.
So The Doctor's "passing" was not and end to his life altogether, but another regeneration, which, as he says several times in the episode, is practically a death, as the current regeneration "dies" and is replaced by someone knew.
So he chose to sacrifice himself to save Wilf, not that he was killed directly by the events of the story.
He didn't want to go.