Thanks for the suggestions, Cloudflare Pages is definetely the correct way to accomplish this.
However just to follow up on my own question, i actually made it work yesterday evening. This way is more low key, and could be used to serve a specific error page during scheduled maintenance for a non critical site.
I made it work, using The Zone Lockdown. Go to Firewall → Zone Lockdown. Create a ruleset, i.e. which subdomain/domain/path you want to lockdown, and specify a set of whitelisted IP-adresses, be aware this a whitelist not a blacklist It’s also possible to locksown your whole domain this way.
Now go to Custom Pages, and set up the Class 1000 error and the IP/Country Blocking with your own specific maintenance page or error page, this can temporary be hosted through Github Pages, at least that worked for me, use the correct tokens
There are several turotials here on Cloudflare community, where you can find some basic html that work with Custom Pages, just insert the above tokens Furthermore Cloudflare pages does allow inline css and JS, I was able to make an animated site hosting just a simple html page through Github pages.