There's some longer-term things you can only learn by being at the same company for a long time (such as "how to grow a startup from 1 to 100 employees" and what comes with that), but those things are usually outside the realm of what software engineers interest themselves with.
If you're spending more than 2 years at the same company, the only domain knowledge you're growing is that of how to be an employee at that particular company, and very little of it is very useful outside of it. Things like "I know how all these Facebook internal tools work inside-and-out". Cool, we don't have or need them cause we're a totally different company, now what?
Whereas a lot of even surface-level knowledge can bring a huge amount of unique perspectives and solutions. And my own most successful projects have been the results of combinations of experience in multiple domains at once.
And none of this prevents you from actually developing deep domain knowledge. For example, I have NOT held the same job for a decade and a half, but I HAVE been using Python (and other various software) for all that time, in a large amount of very varied situations, and I absolutely have "deep domain knowledge" there.
Yeah, they aren't going to be the best with a specific company's stack, but they'll likely have a better perspective on how it can be improved.
I built a full stack app in about 6 months, at one point, 5 years ago. (frontend js framework, backend js framework, SQL framework)
I now work for a company whose applications aren't much more complex than what I built, in terms of systems and complexity. Though the apps are definitely much more polished and with many more complete UX & usage options. It makes millions of dollars.
At least at most large companies which are lumbering, slow moving, where 60% of people contribute and 40% of people barely hang on by pretending to work
(largely because A. they don't know what's going on due to poor documentation and poor requirements gathering, and B. they aren't qualified in the skills needed for currently under development work).
As a solo developer, I move much faster and learn much more on my own, than I do at my current job. Why? Because I direct my own work, on my own projects. I don't have someone who has never built an application, who has a project/product manager title, trying to gather requirements for something they've never done before.
Not to mention that they've never founded an organization and led it to success. So, they don't understand how Apps are built, and the don't understand how Organizations are built and guided efficiently...
Combine this with a company that has a bunch of legacy applications and is now moving into somewhat over-hyped frameworks...
Yeah... Don't get me wrong-- I like the people I work with. I see a lot of under-qualified people in management who are slowing down the system because they can't efficiently organize people to do what they don't understand-- they have too many unknown unknowns in their ability to parse out upcoming work. Unfortunately, most of them were hired for currently-fashionable political reasons.
This is exactly what I’ve found. Most of my work is technically easier than my personal projects.
There are definitely parts that are far more complex, but the vast majority of the company isn’t working in those areas.
From what I’ve seen, if you want domain knowledge you have to dig for it.