An eight-hour delay in admitting a man to hospital before he died was "unacceptable", an inquest has heard.
Peter Connelly, from Fairbourne, Gwynedd, died in February 2018 - the day after being taken to Wrexham Maelor Hospital with acute pancreatitis.
Gary Doherty, the chief executive of the Betsi Cadwaladr University Health Board, apologised to Mr Connelly's family.
The coroner said he is writing to those involved to prevent future deaths.
John Gittins, the North Wales East and Central Coroner, told the hearing that while he acknowledged improvements have since taken place at the health board and ambulance service, he felt more needed to be done.
"I am reassured that what they told me is being implemented and is having an effect but it does not negate the fact that everyone needs to have to try to do better," said Mr Gittins.
He recorded a conclusion of natural causes in the death of Mr Connelly.
During evidence to the inquest on Thursday, the head of the health board said the delays in treating Mr Connelly "shouldn't have happened".
"It did happen - and that's why we are here," said Mr Doherty.
The inquest also heard from the chief executive of the Welsh Ambulance Service Trust about its role in caring for Mr Connelly.
Jason Killens said it was clearly a "difficult and unacceptable set of circumstances".
He said the ambulance trust had now transformed from an emergency service under stress four or five years ago, and was now "stable and solid".
Mr Connelly, aged 70, died from multiple organ failure as a result of acute pancreatitis on 20 February 2018.
He waited outside the hospital in an ambulance from 14:15 GMT until 22:00 on the evening before his death, due to pressures in the A&E department.
In February 2018, 1,600 ambulance hours were lost to crews queuing outside the emergency department at Wrexham Maelor. But the inquest heard this had reduced to 400 by September 2018.
An independent expert, Prof Solomon Almond, said that having reviewed the evidence he felt that though the delay in the ambulance was "unacceptable", on the balance of probability it was not likely to have affected the outcome.
He said Mr Connelly had experienced "an aggressive example of an aggressive illness".