For me, after upgrading to postgresql@16 my issue was that installing the non-default version meant the command line tools were not added to my path. Adding export PATH="/opt/homebrew/opt/postgresql@16/bin:$PATH" to my .zshrc file fixed the issue.
export PATH="/opt/homebrew/opt/postgresql@16/bin:$PATH"