I have worked as an engineer for > 20 years, and I currently work at a company of several hundred people that has been remote-only since its founding before the pandemic. I have personally helped to onboard a junior engineer on my team, and it's gone just as well as the junior engineers I've helped onboard at previous (in-office) companies. You can't make blanket statements like this; it's all about the processes that have been set up to facilitate knowledge sharing, camaraderie, etc.
From my experience, the divestment in training and mentoring, stringent job requirements, and lack of job security through arbitrary performance metrics have done more to make folks feel isolated than proximity to bodies.
By far the most positive experience I had from learning from colleagues was actually when I was a remote member of a team who were otherwise in an office together. They were just very good people who also shared a preference for written communication. We did meet up in person every few months, and that seemed to be enough.