The Tenth Doctor only met Queen Elizabeth I shortly before "The Day of the Doctor". From the Doctor's perspective this was near to the end of the Tenth Doctor;s life, right before "The End of Time". Queen Elizabeth I was a young woman at the time.
However, when Queen Elizabeth I sees the Tenth Doctor in "The Shakespeare Code", Queen Elizabeth I is now an old woman who remembers the Doctor abandoning her. But from the Doctor's point of view, "The Shakespeare Code" takes place years before "The Day of the Doctor", meaning that the Doctor hasn't met Queen Elizabeth I yet.