Five editions in, it is easy to accidentally think you know how a rule works. For example, I just found out via another thread that I have been doing saving throws wrong this whole time: a natural 20 does not automatically save in 5E. Huh.
What were you getting wrong because you made an assumption, didn't read closely and/or applied an old rule accidentally?
At the beginning I didn't have the DMG. I was using passive checks as described in the PHB i.e. very loosely based on my own choices. Then I read the DMG and found that it has more precise rules about using passive perception when searching for hidden things.
Was I playing wrong?
No. Because the DMG isn't even officially "required" to play the game. And because the official WotC stance is that DM's stuff is always meant to be a toolset for a DM to interpret and adopt as they see fit.
If a 20 doesn't succeed, why was anyone even rolling?
If the DM notices that a 20 won't succeed, they in fact don't need to ask for a roll, why assuming they were rolling?
Sometimes however the DM might still want to make players roll just because he doesn't want them to
know that they cannot succeed. If they then roll a 20, the DM can tell them they did so good that they figured out they can't succeed even with the best effort.
And of course sometimes the DM just doesn't notice they can't succeed until they roll a 20, but that's another matter.
Neither of those are how you do it, not that it matters (you can do it however you like).
Group checks, though, would be that whatever the dc happens to be, if half the party makes the dc, then they make the group check. If more than half the party fails, then the group check is failed.
You don't have to use group checks for stealth, though, unless you want to. (It's usually only worth doing as a group check for a "general" stealth check (such as across a fairly large area) not for more specific us-vs-them.
(I'm tired, I don't know if I made that make any sense.)
I think you make very sense. The whole group check section keeps using the term "might" when talking about the DM using group checks. It's pretty much the key of DM rules being tools and not laws. You can use group check and you can not use group checks, and be right either way.