FormerlyHemlock
Hero
Maybe it is not the monsters that are poorly designed, but the rules for ranged combat? Probably somewhere in between.
Also, if you want a Marilith to be good in ranged combat, give it ranged weapons. The MM is not intended to represent every Marilith, they will have different weapons. Heck, I would expect a Marilith that has lived for thousands of years to have magical weapons of many types. I do not, however, expect that these be listed in the MM. I do agree they should have innate spellcasting.
In AD&D, ranged combatant did not dominate melee because most monsters were simply immune to most ranged weaponry: it often took a +2 to greater magic weapon to damage them, and arrows from enchanted bows did not count. Ergo, you had to either kill them with a magic sword/etc., or kill them using memorized spells (and monsters often had % magic resistance that made spells less effective).
In 5E, characters are extremely mobile by default, even moreso if they plan for it (thanks to the Mounted Combat rules and various ways to spend your bonus action, etc.), cantrips like Eldritch Blast can damage almost any monster (very few things have Force immunity) and a simple Magic Weapon spell also makes any bow able to harm even more monsters than Eldritch Blast (I don't know of any non-homebrew monster which is outright immune to piercing weapons), and most monsters have no effective offense at ranges greater than 30'. It's a perfect storm of opportunity for ranged combat specialists.
So yeah, the root cause (fault?) is in both the ranged combat rules and the monster design.