AKL should be fine. You do not need to clear customs and can stay wholly in the international transit zone.
Not sure about YVR (Vancouver). You'll be clearing customs there, which can take time. You'll then have to re-clear domestic security. I don't know about that airport or how long that might take. Maybe research that stop on its own. But at least I assume there are lots of alternative flights between Vancouver or Toronto at that point.