There have been several different evacuations and recolonisations of Earth, mainly due to threats from solar flares - the Beast Below was one of these evacuations, in the 29th Century (and incidentally, the Scots announced their independence then, too) Later, in the Ark in Space, the Earth had been abandoned for 10,000 years before the Doctor awakened the sleeping survivors, saved them from the Wirrn and repaired their teleport to enable them to return to Earth. That was from the 61st to around the 70th centuries.
The Doctor says in Smile ’There were other ships - I've met a few of them' - they may not necessarily all have been from the same evacuation.
Humans always came back, until the Earth was finally swallowed by the Sun , in the year 5,000,000,000 (which the 9th Doctor and Rose saw) and then they created New Earth (visited by the 10th Doctor and Rose) Eventually, there came the end of the universe, and Utopia. Except it wasn't...
As for the robots, the Doctor explained that the original concept of happiness they were supposed to maintain was the colonists' physical state and comfort - enough water, oxygen etc, but they learned and expanded their definition of happiness to include mood, then identified grief as the enemy. 'They wanted to eliminate unhappiness, but to a robot that meant eliminating unhappy people'.
No-one knew that that was what they were going to do until they did it, and all the deaths happened in one morning, so even if the gardeners had known how to stop the robots, they wouldn't have had time to do it.