Homebrew (brew.sh) has changed it’s way of dealing with versioning of software packages.
the previously used brew versions does not work anymore. To find a specific version you first need to tap into the versioning repo with
brew tap homebrew/versions FORMULA
then you can use
brew search which will give you a list of available formulae which can be simply installed with
brew install homebrew/versions/FORMULA-version
if that does not work you can also try to find the commit for the correct version of your software at the brew github repo, and then checkout the specific version with
git checkout HASH /usr/local/Library/Formula/FORMULA.rb brew install FORMULA
if you had another version installed before you might have to unlink and link it again.