All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
It is permissible to keep the corpse in the graveyard until the grave is dug up, and it is not an obligation to return it home.
It is confirmed that Al-Baraa’ ibn ‘Aazib narrated that the companions went out with the Prophet in a funeral of an Ansari man and when they reached the graveyard, the grave was not yet dug up, then the Prophet sat around the grave and the companions sat around it as well, until digging the grave was finished. [Ahmad]
However, it was not reported in the narration that he ordered the corpse to be returned home.
Allaah Knows best.