The second one sounds right, because the word order of adverbials is jumbled up in the first sentence, which would read as "Mary went back late to home at night" in English. The adverbials expressing the same terms should generally be placed next by next.