That’s my experience. I’ll add however that the answer isn’t full time office work like some companies are pushing. Remote work with a day or two in the office should be plenty.
We encourage our younger folks to come into the office at least a little each week, for this exact reason. However, we respect anyone who wants to be 100% wfh. I do straight up tell people that corporate life isn’t a pure meritocracy. People inherently trust coworkers with who they have a personal connection. Those little things like chats in the break room or happy hours after work pay off, even behind professional mentorship.