A man died in Hawke's Bay Hospital after the team treating him got "confused" and pumped air into his stomach rather than his lungs.
Nevara Raheke died on December 1, 2017, two weeks after he was admitted for gunshot wounds to his back.
A coroner's report found an incorrectly placed breathing tube caused Raheke's death.
The tube was placed in his oesophagus rather than his trachea, sending air to his stomach.
Initial checks after the tube was placed appeared to confirm it was placed correctly but no carbon dioxide, the byproduct of breathing, was detected.
The tube was checked again but still no carbon dioxide.
After 23 minutes, a fibre-optic scope was inserted into the tube which showed it was in the wrong place but it was too late.
Raheke was expected to be severely brain damaged as a result of the oxygen deprivation. However after two weeks in intensive care his condition did not improve and he died.
Following his death Hawke's Bay District Health Board conducted an Adverse Event Review into the circumstances.
It found there was "confusion" in the team over who was in charge of his airway. The team itself admitted there was a lack of communication throughout the case.
Hawke's Bay DHB chief medical officer Robin Whyman said the case was "complex" and staff were "deeply affected" by Raheke's death.
"Our deepest sympathies are with the Raheke whānau and their tragic loss and we have apologised to them in person," Whyman told Stuff.
A pathologist found traces of cannabis, amphetamine and meth in his system but ruled it was lack of oxygen, not drugs or the gunshot wounds which killed him.
"It is important not to lose sight of the fact that if Nevara had not been shot then he would not have been placed in the life-threatening position he was in," said the coroner.
The man who shot Raheke stood trial last year for wounding with intent to cause grievous bodily harm. The case was discharged after evidence came to light which meant the Crown could not rule out self defence.