Well - my perspective is the KDE project, which has a team of capable admins who take care of hosting. The project has always been more or less self-hosted (I remember SUSE providing servers) and even provided hosting for at least one barely associated project, Valgrind. I think Valgrind bugs are still on KDE Bugzilla.
It's admittedly not really practical for most projects, but it could be for some large ones - Rust, for example.
KDE uses Phabricator, or at least did the last time I contributed. Worked pretty well in the collaboration aspect for submitting a change, getting code owners to review and giving feedback. I was able to jump in as a brand new contributor and get a change merged. The kind of change that would have been a PR from a fork in GitHub.
However I got the distinct feeling the whole stack would not fit as well into an enterprise environment, nor would the tooling around it work well for devs on Windows machines that just want to get commits out there. It's a perfect fit for that kind of project but I don't think it would be a great GitHub replacement for an enterprise shop that doesn't have software as it's core business
I mostly work on PostgreSQL which has always selfhosted but PostgreSQL is a big project, for smaller projects it is much less practical. Even for something decently large like Meson I think the barrier would have been too big.
But, yes, projects like Rust could have selfhosted if they had wanted to.