The owner carries the legal duty
Under the Building Act, the person commissioning the work — usually the homeowner — is legally responsible for ensuring it complies, regardless of who actually does the building.
Builders and designers carry contractual duty
Your contract with your builder and your appointment with any designer should pass back the obligation to deliver compliant work. The legal long-stop remains with you.
What this means on a real project
If something is wrong, the council writes to the owner, not the builder. The builder owes you under contract, but the regulator looks at the front door.