I had the same problem. The cause was that I installed zsh (/usr/local/bin/zsh) on an Intel Mac and then changed to an arm64 Mac, so the Intel zsh was being used only by VScode. It seems that deleting it with brew uninstall zsh will solve the problem.