As @rob and @drdrang pointed out, there are symlinks you can use that do not contain any version specific info.
You can set an ENV_PATH using the method @drdrang helped me with here a couple months ago. that way you don’t even have to specify the path in the shell scripts.
The brew install command is supposed to create the symlinks for you. On an M1 Mac, the symlinks are in /opt/homebrew/bin/; on an Intel Mac, they're in /usr/local/bin/.
To test this, open Terminal and execute
which displayplacer
If it doesn't tell you that it's in one of those two directories, then something is wrong with your Homebrew setup, and I'm not sure what to tell you.