That's been my experience since I went the garage gym route when Covid affected everything back in Spring-Summer 2020. There's a certain "energy" in some gyms, but most commercial gyms include more annoying people and less energy than a real gym offers. Only downside is temperatures in the summer or winter, but that's why god made space heaters, fans, and plain old dedication/discipline. I call mine the Lone Wolf Gym, and I've never regretted setting it up, even with very basic "black iron" stuff.
This is my second go around with a garage gym. Sadly, when I went through a divorce and moved I didn't have a basement nor a garage. So, I lifted at an underground gym my buddy set up called 22nd Street Barbell. Since I lifted there and didn't have anywhere to put the weights, I donated all of it thinking I would prob lift there a very long time. While I did lift there several years, the gym and its atmosphere started to change. It became more of a commercial gym and an actual business. Prior, we basically had my buddy organize and run the gym, but we pooled money together and purchased stuff as a group. It worked great and our numbers were small. Just a small group of fellas hammering iron.
As it always seems to happen, nothing lasts forever. My buddy hooked up with an attorney who also invested into businesses, and it soon started to become a commerical gym and it changed the whole scene. A lot of nutthuggers and brotards lifting there due to the image that we had created as this hardcore underground gym. I basically got turned off by the traffic and all the douchbaggery and left. I regret ever donated my weights and dumbbells. It is what it is.
But what I learned is similar to your point, I work better alone and where I don't have to deal with crowds and idiots. I have zero issue with motivation. I am picking up a 140,000 BTU kerosene heater/blower this Friday. In the off season I play semi pro baseball so I have my nets, tees and etc already out there so I can take cuts and do my baseball work. But what has been lacking for a few years is my off season work and training and my body definitely can attest. Time to get back.