This warning is received for applications that have not been installed before. If you had installed it on previous version macOS it would allow not to install a compatible previous version. However, there is a solution.
So here's what needs to be done.
- Find a (close) friend with GarageBand installed on their macOS.
- Add him/her to your family group. (Apple Family Sharing)
- Open the App Store
- Click on your own profile
- You should see your own name in the Buyer section. Now click the arrow next to it and view your friend's account
- Find GarageBand and click the Download from iCloud icon
Another option is to log into your computer with your friend's Apple credentials. This solution also works for iPhones and iPads.
That's it. I hope that will be useful.
While it is possible to install an old version, I do not think it ethical to not offer the install older version option. In this case, someone who buys the old mac of someone who is not interested in music will have no choice but to be upset.