Does homebrew have a way to install older versions of packages? If so, that might be worth considering.
If you want Elm installed globally, I would probably recommend uninstalling the homebrew version of Elm and using the following to switch when you need to
npm install -g elm@elm0.18.0
npm install -g elm@elm0.19.0
Personally, I tend to use npm to locally install elm (and elm-test, elm-format) in the correct versions for each project (adding them as dev dependencies in the package.json (example)), and then I can use npx elm
to run the version that’s install locally for whatever project I’m currently in.