Honestly, I don't know how we deal with it unless we create a schedule where there has to be certain people in the office on certain days so that a junior can get the interaction and support which is as much of job training as anything they can do online.
So that's one example of when can do != should do
Once it became necessary to look for a new job every 1 - 2 years to stay current with the market, firms stopped with the training, "they will just leave in two years" they cried. In this world your arugment no longer holds water.
So I understand why some companies and teams bias toward everyone working in an office. And my choice to work at home will prevent me from being hired at those places. I'm blessed there's plenty of work available for everyone, remote or not.