A four-month-old baby boy "didn't stand a chance" after doctors tried for more than two hours trying to resuscitate him after his ventilator machine failed at Birmingham Children's Hospital, an inquest heard yesterday.

Thomas Smith had had surgery to repair two holes in his heart on December 10, 2004, and was put on a ventilator to aid his recovery.

But the machine failed the next day and doctors spent 147 minutes - nearly two-and-a-half hours - massaging the baby's heart before transferring him to a heart bypass machine.

The court heard how on December 12, locum doctor Simon Muckier accidentally switched off that device and how he did not know how to restart it. After four minutes he managed to put it back on in reverse mode, so it pumped oxygenated blood around the baby's body Thomas Smith died at Birmingham Children's Hospital on December 15, five days after having an operation that experts believed he would fully recover from.

Dr Duncan Macro, a paediatric consultant at London's Royal Prompting Hospital called in to review Thomas's case, told the inquest at Birmingham Coroner's Court the prolonged period of resuscitation may be the main reason for his death.

He said: "The failure of Thomas's heart to recover was the result of the prolonged resuscitation of 147 minutes before he was put on a cardiac pulmonary bypass machine, rather than the three or four minute interruption to his care on that machine.

"The most effective course of action would have been to use a self-inflating bag on Thomas and inflate it systematically. But vital time was lost during which time Thomas was not being ventilated."

City coroner Aidan Cotter asked surgeon William Brawn if he was concerned over the timing of Thomas's operation, and whether it should have been performed earlier.

"Sometimes we get the surgery wrong, sometimes patients are operated on much later than they should be, and sometimes we just don't know why they haven't recovered. Even though children may seem okay this can still happen," he said.

"I was quite happy to operate on Thomas at four months."

Satinder Hunjam QC, the family's solicitor, asked Mr Brawn whether Thomas would have survived if he had not suffered a heart attack when his ventilator failed.

"I would have hoped so, yes. Thomas was not a normal patient, he was recovering from a heart operation but was in quite a stable condition," he said.

The coroner is expected to deliver his verdict today.