Sure, but what if we were in an encounter where the wizard didn't have effective spells prepared?
That literally has never happened once in any game I've been in in the past 10 years. Even when dealing with people who want to play pyromancers who only have fire damage... they STILL have SOMETHING useful to do. Heck, the only time I have ever seen a wizard out of options is after they have expended all of their spells and are reduced to only doing cantrips (which are still highly effective.)
My monk's punches and maneuverability are almost always handy. I've seen many battles where a spellcaster contributed basically nothing - their spells were resisted or they had a lousy damage roll and then the target made a saving throw... I think just as we've seen that fireball that rolled great and fried seven orcs at once, we've also seen that fireball that wound up doing 10 damage. Spellcasters tend to be more flexible, but also more high risk.
"I used something that could reshape the battle, but it failed" is fundamentally different than lacking the ability to reshape the battle. I mean, sure, I've seen times when the caster tried to do something, and it failed. But the key difference with someone like a barbarian or a monk is that they don't have those options. Maybe a monk with stunning strike? But a barbarian? You can't even ATTEMPT something that might fail like that. You just have attack and survive being attacked.
With your example, it sounds like playing a barbarian is not for you. Barbarians, even more than fighters, basically do two things really well: take and deliver damage (at least when sub-classes are taken into account, since fighter sub-classes offer a lot more ply style options than barbarian sub-classes do, IMO). And there are some folks who love playing barbarians. In our current campaign the player with the barbarian is loving it; his previous two characters were a mage and a wizard and he is enjoying just getting to smash face for a change.
He is very effective, and vital to our success. I agree that he doesn't have nearly the options that my spouse does with their artificer, but he delivers way more damage, more consistently.
Why is it that the barbarian is designed to only do two things? Why is that an acceptable design? There are three pillars of play, and you are essentially saying Barbarians are only good in 30% of the game at best. Except, in combat, there are more things than taking and dealing damage. So... why do you not see this as a design problem?
Also, I played a barbarian before and had a lot of fun. Great Character. Ancestral Spirit Barbarian, so in addition to hitting things and getting hit... I could shield my allies. It still got a little frustrated at being so limited, but I had tactical options. Even if it was just one tactical option.
Every class can't do everything.
No, only some of them can. That's the problem.
A wall of force is going to be a problem for most characters; it is designed that way (what if you have a wizard, but they didn't happen to have disintegrate prepared?). Spellcasters do have more options, by and large. Mundane classes have fewer options but tend to be very good at them. I guess we just disagree on the basic viability of non-magic classes. I think barbarians and fighters are very viable; I am never disappointed to have one in the party.
But what do we mean by "viable"? Is it like saying they have role-play potential? Sure, everyone has role-play potential. Are they capable of not being useless in a fight? Sure, technically speaking, but they are never the class that pulls out the hail mary. The best Barbarian stories usually involve getting buffed by a caster to be more effective before killing something. That's all they have.
And you can accomplish the same thing with paladins, who also have a lot of utility abilities and also do reliable good damage and are reliable tough front-liners.
The irony is that we spend so much time arguing about the viability of fighters, in particular, but they are by far the most popular 5e class according to the data we have, and are generally considered a good class that can fill a vital role, tanking, in any party, and are also an excellent DPR class. If we are talking mundane/martial classes that are don't have a super vital role, shouldn't monks and rogues be at the heart of the conversation?
Maybe, but monks are a mess for a lot of reasons, and I've already discussed my thoughts on why rogues don't seem as blatant. Partially, it is because when Fighters and Barbarians get looked at across all three pillars... they utterly fail at two of them. They are ONLY good in combat... and a well-build caster or one of the half-casters can be better tanks and better DPR. While also not being abysmal jokes at literally anything that doesn't involve initiative.