"A very serious marine casualty" was narrowly avoided when the ship shut down in the Cook Strait, investigators says.