New Zealand still wanted Malaysia to waive that immunity. If that did not happen, extradition was an option.
The rug was pulled from under them, however, by the ambiguity of some of the ministry's "informal communications" with the high commission.
These contacts had left open the possibility of a different course of action and ended up delivering exactly the opposite outcome than the Government had wanted - that New Zealand was happy for the disgraced diplomat to return home.
This appalling piece of diplomacy was effectively trumped last night with common sense prevailing and Malaysia announcing the diplomat would return to New Zealand "to assist in the investigation of the charges".
The decision would have been no skin off Malaysia's nose, but enabled McCully - who had spent the day apologising to all and sundry - to grasp a reasonable victory from the jaws of defeat.
The question remains as to why the officials got it it so wrong initially. And, having got it so wrong, why they compounded the problem by failing to tell their superiors while supplying incomplete briefing material to Key and McCully.
The question might get an answer after an independent review initiated by John Allen, the ministry's chief executive, has focused on those "informal communications".
The debacle brought the chain of responsibility into sharp focus. It is unlikely McCully offered Key his resignation. McCully can claim the old defence of being responsible, but not to blame. And, anyway, Key would never have accepted his resignation - especially in the light of last night's stunning breakthrough.
Allen is understood to have offered to step down, but was apparently told likewise by McCully to stay on.
So the lower-level officials are the ones in the gun. They have some rather tricky, but crucial questions to answer.