Police have been criticised for the way they dealt with a 999 call for help from a man who was later found dead.
There was a "significant failing" in the way officers handled events leading up to the death in Edinburgh last year, the Police Investigations and Review Commissioner (PIRC) found.
The commissioner, Professor John McNeill, criticised a "lack of prompt action" by police after neighbours reported the man missing on March 26, stating he was under threat from a local drug dealer.
The 52-year-old was known to police as a vulnerable person with serious health and alcohol misuse problems, the independent investigation found.
He made a 999 call three days later to tell police he was dying and asked for help, hours before his body was found at the home of a friend.
The emergency call was made from a mobile in the Restalrig area of the city but area control-room staff sent officers to the man's own home 4.5 kilometres away in West Pilton, the PIRC report found.
When the missing person report and 999 call were later linked, a recording error meant police were sent to the wrong address in Restalrig, where they left a calling card.
The man was found dead at 8.15am that day at a house next door.
Mr McNeill has made several recommendations to Police Scotland, calling on the force to review the management of missing person inquiries in the Edinburgh division.
The case should have been categorised as a missing person inquiry from the outset and officers should have forced entry to the man's house to establish whether he was there, he said.
Failures in the way the Edinburgh area control-room records reports of missing people and manages 999 calls should also be examined, the report said.
Control-room staff appear to have downplayed the seriousness of the emergency call, downgrading it to a lower priority.
The decision to leave a calling card for a man who had called 999 to say he was dying was also criticised as "inappropriate and a serious error of judgement".
The actions of individual officers and staff should be investigated by the force, the report concluded.
Mr McNeill said: "After examining the available evidence I found that the lack of prompt action to trace the man and obtain medical intervention was a significant failing. The decision to downgrade the 999 call was clearly erroneous.
"It is also apparent from the circumstances that the initial call on March 26 2013 should have been considered a missing person enquiry either at the time of initial report or very shortly thereafter.
"The decision by the police not to create a missing person inquiry was a contributing factor to the overall lack of effective incident response and control.
"As a result of these failures, police senior management were left unsighted on inquiries to trace the man and, therefore, were denied an opportunity for effective direction and control."
A force spokesman said: "Police Scotland thanks PIRC for their report.
"We will study all the evidence provided by PIRC and note that a number of recommendations, which includes examining the actions of officers and staff, are specified.
"Police Scotland is committed to keeping people safe and officers across Scotland continually work to ensure the service we provide to our communities meets this commitment.
"The force aims to continually improve and will rigorously review the points specified by PIRC to ensure we learn from this investigation."