I tried the function with `zsh -f` (which I should have done before posting..), and found that it worked as expected. Something else is causing this issue, so I'm closing this question when able.
**EDIT** :
For those interested in what the issue was, and how it was solved, look below.
I used the zsh framework ZIM which uses `vcs_info` to check if the current directory is used by git or not. This requires a call to git. `vcs_info` itself does not call git directly, it would seem, not by default.
However, thanks to ft on #zsh on Freenode, adding
`zstyle ':vcs_info:git:*:-all-' command =git`
to `~/.zshrc` after the framework has been sourced, has fixed this issue.