This could happen if your /tmp (or wherever your $TMPDIR
points) were read-only.
You should be able to discover what's wrong by attaching strace to the zsh you're running the above from, using e.g. strace -ff -s200 -o /tmp/zsh.log -p PID-goes-here
from a different shell.