Why not run a docker container locally with Postgres and code against that? Then everyone is using the same Postgres version.
I think it should work like almost Linux distros where the major version is fixed for a release lifecycle, and any other installations require modification. So say brew install postgresql should always install 12, and if you want something else you have to add the version modifier.
But I agree that's nothing to do with brew conversation.
Containerized Postgres is a real win, but running OpenLDAP (+ custom schema) as a containerized application has measurably improved my quality of life. Kudos and great gratitude to the people behind https://github.com/osixia/docker-openldap