Maxperson
Morkus from Orkus
A few corner case monsters do not an issue make. I mean, a Rakshasa is immune to spells under 7th level and has advantage on saves over that. It's CR 13 and can be encountered below 13th level where a full party of casters would have no way to hurt it at all. Even if they are 13th level, they have exactly 1 spell each that they can use and it has advantage on any saves.Let's look at an all martial party. A 20th level battle master fighter, samurai fighter, berserker barbarian, and assassin rogue. No magic items.
How do they take down a Demilich (CR18, which should be an easy encounter)? It's immune to non-magical weapons.
CR4 Coatls could give them trouble. Again, immune to non-magical weapons,

It's okay to make an incredibly easy game a bit more challenging.The mummy rot from a CR15 mummy lord would be a death sentence if they can't find an NPC to cast remove curse on them (or simply can't reach them in time - no access to teleport).
I also dislike how the game treats strength differences.If most of them are strength based, even CR 3 manticores could give them a hard time (because strength based ranged weapons have a pitiful range). Since javelins only have a maximum 120' range, the manticores can move away after they attack and perpetually remain out of range, allowing only a readied action at disadvantage to counterattack. Admittedly, this is not nearly the same issue for dexterity oriented martials.*
*Which brings me to a tangent that really grinds my gears. Why is a 1st level wizard with 8 strength able to lob a javelin the same distance as a 20th level fighter with 20+ strength!?
So there are monsters that give casters a lot of hassle, and monsters that do the same to martials. Once in a while it's okay to use one against a group that can't win against it. Not all encounters need to be winnable or should be fought. The martials can use persuasion to negotiate with the manticores and even the lich.Not to mention running up against something like a wall of force blocking their path or getting imprisoned in a forcecage.
Now consider a 20th level party of all casters. A life cleric, abjuration wizard, moon druid, and lore bard. Again, no magic items. Do you honestly think that any of those encounters I listed would give them much trouble? I seriously doubt it.
There are plenty of encounters that an all martial party will struggle with (or find downright impossible) at both low and high levels, without the right magic items (or support from a spellcaster). Whereas caster will have little to no trouble with most encounters. Even against a beholder with it's anti-magic eye, all they need to do is spread out so it can only target one of them at a time.