This is an extremely common problem for juniors in the mentoring program where I volunteer: They graduate college, take remote jobs, and then slide into depression while working from home. It takes a while to work with them to get to the bottom of their issues, but often they'll realize that they're much happier in the weeks following company on-site meetings, then they slowly decline again.
Remote work doesn't work for everyone. Many people struggle in remote environments, especially juniors. The way remote work gets pushed as being perfect for everyone can be very confusing for people who discover that they don't like it.
It's even harder because the internet tends to be very hostile to these people rather than supportive. The correct answer, obviously, is that some people do better at different types of jobs. Yet every time this comes up, people come out and try to criticize the person, blame it on their lack of hobbies, blame it on something else, and refuse to allow that some people need face-to-face coworkers to thrive.
It's a real phenomenon that gets downplayed on the internet.