A man who died from organ failure was left "begging for help" as he laid in an ambulance outside hospital the day before his death, an inquest has heard.
Peter Connelly, from Fairbourne in Gwynedd, died in February 2018 after being admitted to Wrexham Maelor Hospital with pancreatitis.
Mr Connelly's wife Denise said her husband's death was "cruel".
Gill Pleming, from the Welsh Ambulance Service Trust, said there had been some improvements since Mr Connelly's death.
Mr Connelly, a retired shopkeeper, arrived at Wrexham Maelor Hospital at 14:15 GMT on 19 February 2018 and was given painkillers and monitored by paramedics.
He was not admitted to hospital until 22:00 and was swapped to another ambulance while the crew that had brought him in went off shift.
Mr Connelly died the following day from multiple organ failure as a result of acute pancreatitis.
In a statement read to the inquest at Ruthin, Mrs Connelly said her husband had fallen ill that morning and she knew the problem because he had the same issue two years before.
She called 999 and was attended to by community first responders and an urgent care ambulance, but a paramedic was dispatched when his condition deteriorated.
"I believe that had he had treatment when he first arrived he would have been with us today," she said.
"The way he died was cruel. I just don't know what went wrong."
Ms Pleming told the inquest the day Mr Connelly was brought in had been "challenging" across all three hospital sites.
Ambulance staff spent 178 hours queuing outside Wrexham Maelor, Glan Clwyd and Ysbyty Gwynedd that day.
Ms Pleming said she had seen some improvements since Mr Connelly's death.
John Jones, the team leader of the Welsh Ambulance Service Trust at Wrexham, said the delays "don't seem to be as long" as last year.
Alison Hughes, a nursing sister at the hospital who was shift leader the day Mr Connelly was admitted, said the evidence painted a "grim picture".
She said they were short of three nurses and adults were being treated in the paediatric ward because of a shortage of beds.
"It was a bad day," she said.
Dr Fiona Rae, the senior doctor on shift in the department, said "things were pretty bad".
She said Mr Jones approached her to ask to administer more morphine to Mr Connelly, which she agreed to, but did not treat him personally.
"I don't think I would have done anything differently," she added.
"Sometimes it feels like we're being constantly told we should do things better - not unreasonable - but we are not always given the resource or support to do that."
Michael Thornton, the on-call surgeon the day Mr Connelly was taken ill, said gall stones were the likely cause of his pancreatitis.
He said: "The time spent in the ambulance is awful but I agree that in all probability, it wasn't going to change the outcome."
The inquest continues.