The mix-up happened at the Queen Elizabeth University Hospital in Glasgow where two men with the name William Paterson were due to be collected by undertakers.
Funeral director David Robb discovered the error when he tried to collect a body on November 25.
The Mr Paterson he was to take into his care had already been collected by Co-op Funeralcare three days earlier.
Mr Robb quickly contacted Co-op and collected the body which he said had been sealed in a coffin, ready for cremation.
The Co-op has apologised to the family but said it was not made aware there were two men of the same name at the hospital.
Mr Robb told The Herald: “When I arrived at the Co-op I saw that there was a William Paterson in a coffin, sealed and ready to go for cremation.
“At this point he would have had to be checked by at least two staff.
“As soon as I opened the casket I knew it was him, he is the double of his son. If I had decided to take that weekend off there is an extremely high chance that it would have been too late.”
The Inspector of Funeral Directors has been informed of the case.
A Co-op Funeralcare spokeswoman said: ‘’Going through the death of a loved one is an incredibly difficult experience and our focus as a funeral director is always to support families in any way we can.
“If a family is left unhappy for any reason, we consider this to be of great importance.
‘’As soon as the issue was brought to our attention we acted immediately to resolve it and have since arranged to visit the family to offer our apologies in person.
“On collection of Mr Paterson we unfortunately were not made aware that there were two individuals at the hospital with the same name, however, after a full investigation we accept that an error was made on our behalf and we can only apologise to the Paterson family for this.
‘’We have robust procedures when taking loved ones into our care and have since reviewed these further to ensure the correct identification processes are in place to reduce any risk of this happening again.’’
Mr Paterson, 56, is said to have died of pneumonia, a complication of lung cancer and a stroke.
A spokeswoman for NHS Greater Glasgow and Clyde said: “Our normal robust process for transferring deceased patients to an undertaker failed on this occasion.
“It was a genuine error and we would like to apologise for any distress caused.
“As soon as the error was identified we quickly worked with both undertakers and as a result there was no delay to the funeral arrangements.