Well, the guidelines are just guidelines. I think folks on both sides of the discussion tend to treat them as if they are absolute, or that they should be expected to be absolute. I don't think that's the case....they're there as a tool that can be used to approximate challenges to aid in encounter design.
Personally, I don't even look at them at all anymore, and only glanced at them a bit earlier on in our 5E campaign. At this point, I feel like I have a strong enough feeling for what is needed to challenge my players.
For instance, I used a Marilith and I did modify her in a couple of minor ways. Teleport was a move action, and she could use her parry against ranged attacks as well as melee attacks, so she was able to use her reactive ability to counter ranged attacks as well.
I also gave her a couple of potions that she used prior to combat.
The fight went pretty well, all around. She did scare the PCs and impress upon them how capable she was, but at the same time, she probably wouldn't have lasted all too long if she simply stayed there and went toe to toe with the party.
I think the fact that my players haven't already memorized all the monsters in the MM also helps. When players know the monsters' capabilities ahead of time, it's that much harder to challenge them. I think in cases like that, you must modify the monsters. Every Marilith being exactly the same is no less ridiculous than every adventurer or every elf or every fighter being exactly the same.
People have mentioned how smart such creatures are, and yet none of them ever seem to flee, unless the ability to to so is baked into the stats. I doubt a genius tactician who's survived in the Abyss for centuries would just accept that a group of primes can slaughter her because she can't innately teleport without error as a bonus action. So if a Marilith finds herself in trouble....have her cut and run like she likely has done over her centuries of life. Then have her come back later at a time of her choosing, far more prepared to deal with the adventurers in question. Seems pretty simple and likely, actually.
As others have said, if she's a general type, why not have her with other foes to assist her? And if she's solo, why would she not be cautious? Certainly a tactical genius would realize how deadly a group of adventurers can be, and would plan accordingly. Have her prep and be ready for the trouble she's likely to face.
Those are good modifications to the marilith. I thought about making teleport a bonus action, but I wanted to test some of these monsters as they were designed. This is my first time running higher level 5E. I played as a player in a campaign to 15 and I think I have a good feel for dragons, not so much demons. I'm definitely getting a feel for some of the things I need to do to match the players such as improving mobility for melee creatures and increasing the number of abilities for monsters like higher end demons.