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.

 1. Find a (close) friend with GarageBand installed on their macOS.
 2. Add him/her to your family group. (Apple Family Sharing)
 3. Open the App Store
 4. Click on your own profile
 5. You should see your own name in the Buyer section. Now click the arrow next to it and view your friend's account
 6. 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.