If we talk about systems, rulesets, etc. then for DnD campaigns a party of 4 is actually the gold standard. If we talk about RPG storytelling then 4 is once again better than 6+ because larger cast means you either get less personal involvement with each individual companion or some companions fail to foster any kind of emotional attachment.
See? This is the hideous problem with recurring topics... That some of us are basically condemned to this comedic Groundhog Day of repeating the same talking points over and over and just few weeks later being forced to listen to the same "rebuttals" we already dismissed a good dozen of times even in the very same "megathread" we are posting in.
The short version: - the "party of 4 is the sweet spot" is a convenient claim for pen & paper because gathering more people on a regular basis can turn into a logistic nightmare. Even then, ideally people aim higher than that, especially given that not every member will be reliable from start to end. - In pen & paper each member of your party is (allegedly) a thinking entity that contributes significantly to the conversation, the decision process, etc. In a CRPG any companion offers a narrow and limited contribution in that sense and limiting them in numbers even more strips the game away of more engaging content. Party banters, personal quests, reactions to specific situations, etc. - Most pen & paper campaigns don't drag for hundreds of hours and even when they approach that time frame players often drop out, get replaced, rotate, etc. If I'm stuck with the same party of 4 in a computer game there will be piles of things I won't ever experience.
Basically, the summary of it is that one thing does not equate to the other. They are extremely distinct experiences and using a vague suggestion thrown in as some sort of consolatory claim in the PHB as a Gospel of Truth is pointless, if not even disingenuous.
That aside, limiting the group to 4 feels painfully restrictive not just when it comesto narrative/dialogues/cross party interactions etc, but even in gameplay/mechanical terms. Picking roles, taking advantage of all the rewards offered by the game, etc. You either make an active effort to make sure your four guys cover the most different basis in every possible way with virtually no overlap (which also means "fuck you" to most "hybrid roles" and exotic less-than-overtuned classes) or you'll end with ton of equipment unused, class-specific quests not explored, etc, etc.
I mean, as an example above all: let's say I want to play a class X which is already covered by a companion I like. I couild consider to double that role with some minor differences in specialization for a larger party, but with four slot included mine? I ether reduce the range of my party capabilities even more drastically or I'm basically forced to excluded that companion as a viable option.