You're absolutely correct.
Because D&D completely depends on social interaction, everyone at the table will make (or break) the game and the difference between a 'good' group and a bad group is night and day. However, in my experience, I've found that 'bad' groups are usually poisoned by one or two cunts that make everyone else at the table miserable. Unchecked, the cunts will start a death spiral as other players start skipping sessions and skipping is a highly contagious malady. Before you know it, the group will have completely fallen apart. It's tough, but the only way to preserve the group is to address the problem(s). Some players don't realize they're being a cunt and a conversation (or two) is enough, but some folks just aren't compatible and they have to be removed. I absolutely hate doing it, but I don't think I've ever been unfair. In fact, in 95% of those situations, the rest of the group will ask me why I didn't kick that person earlier.
As you mentioned, flakey DMs suck. Super strange and/or adversarial DMs are a common reason that a lot of groups fail. I know I'm being Captain Obvious here, but some DMs don't seem to understand that the role of the DM isn't to 'punish' the players or try to kill them because you can do that at literally any moment. The role of the DM is to simply provide an environment for the PCs to explore and interact with. Sometimes the choices of the players come with hefty consequences but I rarely get any pushback when bad things happen because my players know they can trust that I am not out to get them. Whatever happened was a result of the choices they made.
That said, a good group doesn't require people that are rules experts or S-tier roleplayers, they just need to have some common courtesy, buy in to the game, and show up on game night.
I started playing D&D at 12 (34 years ago) and I've seen or played with groups that were total trainwrecks, but I've also been in some amazing campaigns that I mourned like a death when we all eventually went our separate ways.
My current campaign is 30 months old, but we're on the back end and it'll come to an end in 3 to 4 months. Overall, it's been fantastic. It started out a little rocky because I had never used a VTT and Fantasy Grounds has a fairly steep learning curve. Also, having always played face-to-face I take a lot of cues from my players body language, facial expressions, and other non-verbals. It's a lot easier to lean into (or pivot away from) things when you have constant visual feedback from the players and it was difficult getting used to the fact that I didn't have that tool anymore.
Even now, I occasionally learn something new about FG and the platform still has a few problems that irritate me, but now that I've got a firm understanding of the program our weekly sessions are smooth.