And individual departments can/do have their own GitHub org. Eg the Office of National Statistics. Some work I did ~10 years ago can be found there! https://github.com/onsdigital
Why do you think this is substantial? The software built in these repos is not tied to GitHub.
Git is decentralized and using a self-hosted instance of Gitea / Forgejo will give you a replacement for the essential parts of GitHub. GitHub is absolutely replaceable.