You ask
Is it illegal for a company to own an overseas company that breaks the law?
And
I’m wanting to start a company in Curaçao to provide online gambling. Providing “remote interactive gambling” is illegal in New Zealand.
An appeal to general principles is not going to be particularly useful if the law that forbids "remote interactive gambling" in New Zealand says something specific. This law is the Gambling Act 2003.
Now this is a complex act with hundreds of sections and dozens of definitions, and plus this is the internet, so we can't give you actual legal advice, but I can point out that the definition of "remote interactive gambling" says (edited for brevity and pertinence):
remote interactive gambling (b)
does not include (iii) gambling by a person in New Zealand conducted by a gambling operator located outside New Zealand;
So it's possible that the situation you imagine does not violate this act. But you need to look at several things first:
would the Curaçao company's gambling activities in fact count as
"conducted by a gambling operator located outside New Zealand" for this purpose?
would there be some other violation of this act even if the definition of "remote interactive gambling" is not met?
would there be a violation of some other act?
Fines for violating provisions of this act range up to $5000, with advertising overseas gambling at the top of the list. With a law of this complexity and stakes of this magnitude (gambling imagery caught only in proofreading, but I'll let it stand), it would be sheer folly to embark on such a venture without retaining a lawyer who has significant experience relating directly to this act and to the question of corporate liability in multinational corporations.