Newly released documents show major ructions at the country's most high-powered building products quality approval scheme.
The CodeMark scheme's rules were flouted, its records a mess and officials were often at a loss as to what was going on.
The scheme provides an ironclad guarantee that products conform to the Building Code, the only scheme that has such legal power over council building consent officers.
But emails released under the Official Information Act show that behind the scenes, government officials were not even sure what products had certificates from the scheme.
"Urgent and important," reads a July 2019 email from the scheme's owner, the Ministry of Business Innovation and Employment (MBIE), to the administrator it had appointed, JAS-ANZ (the Joint Accreditation System of Australia and New Zealand).
"We have identified some concerning differences between CodeMark product registers."
In fact, the ministry's legal register was showing that a leading certifier had 66 CodeMarks active, but JAS-ANZ's registered showed just half that - 34.
Someone had failed in their legal obligations to notify authorities of what certificates had been suspended or withdrawn.
MBIE's response betrays alarm in its bold italics: "Because of the anomalies ... we are formally requesting JAS-ANZ to remove ALL CodeMark New Zealand product certificates from its registers within the next 24 hours."
It is unclear from the OIA material if this happened, but the ministry told RNZ it had done a review with JAS-ANZ's help, and was "satisfied" the publicly available CodeMark register was accurate and up-to-date.
A year ago, in mid-2018, another eight CodeMarks had gone missing off the register, but months later the ministry's calls to address had gone unactioned.
"MBIE have not had any response regarding the status of those certificates," it said in late 2018.
The documents show a pattern of JAS-ANZ ignoring the ministry's pleas.
"Over the past months, MBIE has written to JAS-ANZ on several occasions. We are concerned that a number of the matters raised have not been fully acknowledged or addressed," the ministry wrote to JAS-ANZ in October 2018.
"Is there any action you might take in this regard?" MBIE asks the administrator in August this year, about the largest certifier, CertMark of Queensland.
MBIE was worried that CertMark might break the rules to try to get back into the New Zealand market, from which it had withdrawn after its high-rise cladding panel certificates were found to be badly flawed, in the wake of extra scrutiny triggered by the London Grenfell Tower fire.
CertMark has not re-entered the market yet, but emailed MBIE in August to say that some clients wanted it back, and that JAS-ANZ had told CertMark it could "reapply for a scope extension to include the NZ CodeMark scheme".
The ministry said such an approach would not work, and emails show it was clearly worried about what JAS-ANZ was telling certifiers; and that it was also uncertain if JAS-ANZ, based in Canberra, was aware the high-rise cladding certificates had been suspended in this country; or if JAS-ANZ even understood the demands the New Zealand Building Act placed on CodeMark - that the products certified must meet the Building Code, no question.
The documents show MBIE was fully aware of "myriad errors" by the largest certifier, CertMark, which was not auditing or evaluating products properly, or assessing if its staff were competent, and which had had problems from the word go in 2011.
But nevertheless it went on to become the dominant player, issuing twice as many CodeMarks in New Zealand as any other certifier and also dominating Australia's version of the scheme.
MBIE presented a list of concerns about CertMark, to JAS-ANZ in June this year, noting JAS-ANZ's failure to respond to a complaint last year.
"Looking at it, MBIE should have, without a doubt, been more active in following up these matters," a top official wrote.
Other emails show those officials struggling with another major certifier, Beal, which they eventually booted out of CodeMark late last year, but not before Beal had tested the rules.
"This certificate should have been rejected by JAS-ANZ and BCS [Beal] told firmly that they have no authority to carry out this function while suspended," MBIE emailed JAS-ANZ in late 2018.
"We were surprised and disappointed."
Beal has now launched its own product compliance certificate, by drawing unflattering comparisons with CodeMark and asserting that only its scheme "can meet councils' and certifiers' need for assurance and certainty."
Ironically, MBIE, which promoted CodeMark as rock solid but is now overhauling it, warned Beal in August that its presentation contained incorrect statements that might breach the Fair Trading Act.
It also alerted the Commerce Commission.
Beal had since removed the statements, the ministry told RNZ in a statement.
A document marked "strictly confidential and privileged", provides some reasons as to why officials put up with getting the run-around, as they discuss how any clampdown on major certifiers like CertMark and Beal might backfire: "CodeMark effectively becomes inoperable because the conditions under which certifiers must operate pose too high a cost ... Users lose faith in the CodeMark scheme ... reputational and financial risk for all parties ... contingent liability for all parties."
The government is now proposing as part of its overhaul of building regulations, that MBIE, not JAS-ANZ, administer the CodeMark registers of certifiers and certificates.