This is my own head canon about what happened between DOTD and TOTD
The Doctor walked around the console, running his hands over the controls. He had been brooding for days. Or was it years? Somewhere out there the Time Lords were alive in a pocket universe. His people were still alive. He had not destroyed them all. In fact, it was the opposite. He had saved them. But he feared the knowledge of his act had come too late. His time was ending soon. He could feel it in both of his very ancient hearts. He would be buried on Trenzalore, and the Time Lords would forever be stuck in the wrong place and time, alone in an empty universe.
He knew it did no good to dwell on such things. Everybody died, and when it was his turn, there would be no fighting it. That was the way of the universe, but still the weight of it was nearly crushing him. He took a deep breath, running his hand through his hair. He had to move on, continue, embrace all the moments that he had left. He needed a distraction to get his mind off the despair plaguing him. He needed an adventure with his Impossible Girl.
Thinking of Clara brought a small smile to his face. She had forced her way into his life, helping to pick up the pieces of his shattered heart after losing Amy and River.
"Oh, River," he whispered, his hand hovering over the controls. He had known from the beginning how she would leave him, but it didn't make it any easier. He sighed. He had lost so many, and so much, and it never got any easier.
Shaking off the memories, he punched in the coordinates for Clara's flat. Twirling around the console, he pushed buttons and turned knobs. With a flourish, he threw the lever to begin the dematerialization sequence and send TARDIS into the vortex.
Suddenly the time ship began to shudder. It felt almost as if she were fighting with herself between where she wanted to go and where she knew she needed to go. She pitched and shuttered violently, bells and buzzers alarming, warning of impending trouble. The Doctor ran around the console trying to discern the problem, but he was quickly thrown to the ground by a violent shake. He struggled to stand again but to no avail.
Then as abruptly as it had started, it was over. The lights flickered once, and then all was calm.
The Doctor jumped up, brushing imaginary lint from his pants. He ran around the console trying to discern what had gone wrong, but he found nothing. Everything looked as it should. He frowned at the Time Ship, wondering at her dramatic fit. But then he shrugged and headed towards the doors. Sometimes the TARDIS, like all the women in his life, just got herself into a mood.
The first thing he noticed when he opened the doors, was that he was definitely not in his intended location across from Clara's flat. Still, he did seem to be in the correct city and correct time period. He could do with a little walk anyway. It would give him time to clear his head a bit.
He chose a direction and began heading away from the TARDIS when abruptly he stopped. Something was not right. Yes, it looked like London, but something was off. He took a deep breath and bounced on his toes. The air smelled just a little different. The ground did not feel quite as it should. And his sense of time felt completely off, almost as if he were in an entirely different…
His eyes widened and he whipped out his sonic screwdriver. Flicking it on, he scanned the air around him then turned the screwdriver towards him to look at the findings. As the swirling circles of his language scrolled by, he began to panic, his hearts nearly beating out of his chest.
"No,no, no," he muttered, "this is bad, this is very, very, properly not good."
Turning around, he raced back to the TARDIS doors. Perhaps he could get out of here quickly enough to avoid any universe destroying catastrophes. He yanked the key out of his inner pocket and inserted it into the lock. Trying to turn the key, he found that nothing happened. She had locked him out! His TARDIS had locked him out!
Pounding on the door with his palm, he yelled for her to open the doors, but she stubbornly refused. Several people passed by, giving him odd glances. Finally he laid his forehead against the doors.
"What are you playing at?" he whispered, "we should not be here. We cannot be here. This is wrong."
She would not be reasoned with, however. He needed to be here, and so here is where she took him. He knew where she wanted him to go, but he fought it. He took a shuddering breath. This was his past, a past he had stored away in his mind and moved on from, just like all the other painful things in his past. Why would the TARDIS bring him back here now?
Finally, he straightened up. He knew there was no reasoning with his TARDIS when she had made up her mind about something. He would just have to face whatever she had brought him here for. But before he left, he pointed a finger at the doors and sternly told her, "I don't know what you are playing at, but it is your fault when this all goes pear shaped!"
Then he took a deep breath, straightened his bow tie, and walked off towards his destination.