A hospital consultant apologised to the family of a toddler who died after his operation was delayed by three days due to a lack of beds, an inquest heard.
Kayden Urmston-Bancroft was admitted to the Royal Manchester Children's Hospital on 12 April 2016 and needed surgery for a diaphragmatic hernia.
The 20-month-old suffered a cardiac arrest on 15 April, while waiting for his operation, and died two days later.
Paediatric surgeon Jigna Sheth said she felt "devastated" for the family.
Miss Sheth said: "I apologised that it hadn't been sooner, given the situation we found ourselves in.
"I think it goes without saying that had he had his surgery, when he was well, we would have expected a good outcome."
The court heard that Kayden, from Stockport, had been transferred from Stepping Hill Hospital and placed on a list of patients requiring emergency surgery.
There were no beds available in RMCH's high dependency unit (HDU) so he was not able to have the operation, his medical notes said.
His mother Shannon Bancroft was "very upset" at the delay, according to the medical notes.
But a report by the hospital's clinical head James Bruce showed that a HDU bed had not been requested for Kayden until 12:00 on 15 April, the inquest heard.
Shortly after, surgical staff were told there was a bed for him and records showed there had been three beds available in the HDU that day.
The inquest heard that Miss Sheth was on the on-call consultant on 15 April but when a space in theatre became available at about 20:00 BST she allocated it to a patient who needed an operation on their appendix.
She said she was not the consultant with overall responsibility for Kayden but she had received a handover from Mohamed Shoukry, the consultant who was caring for the toddler, which had not raised any issues.
She said the patient who took the theatre place was in an unstable condition, and added: "Kayden's stability had not been brought to my attention."
"If he was being seen by somebody who was able to make clinical decisions then they are able to, if they feel it is appropriate, have him facilitated in a more extraordinary way than routine," Ms Sheth said.
The inquest continues.