I have a binary file named x in my path (not the current folder, but it is in the PATH), and also a folder with the same name in the current working directory. If I type x, I want the binary to execute, but instead it cd’s into that folder. How do I fix this?

Just put a unsetopt AUTO_CD in your .zshrc.

Refer: How to disable “auto cd” in zsh with oh-my-zsh