Here's how I see it.
The 6th dungeon in Yawning Portal is Against the Giants, which recommends characters start at level 11 and gain a level after each of its three chapters, meaning characters in your campaign would be level 14 when they reach Tomb of Horrors.
However, if you look at the challenge ratings and XP offered by monsters in ToH, you see it's all a bit strange. For one thing, Tomb of Horrors is not a hack 'n slash, it's more of an experience dungeon, so there aren't that many creatures to fight. But the ones that are vary wildly in difficulty.
You have Greater Zombie and Siren, for example, meant for parties of levels 5 and 3 respectively
... they take some thought to beat, but they don't even compare to
the Mummy Lord that sits in the middle of the dungeon, let alone the frickin' Demilich at the end (which also has Trap Soul). The Demilich alone would wipe your entire party in three rounds if they went in at level 14.
The other weird thing about this dungeon is that even if your party does kill every creature, they'll each come away with about 15,000 XP gains, about 10,000 points short of leveling up to 15. There just aren't enough creatures in the dungeon to level up.
So what I intend to do when I run this dungeon is to beef up the encounters with more creatures of higher difficulty so that my level 14s do get that XP and hit lvl 15 by the end of the dungeon.
I will leave the demilich at the end of the dungeon though. He will
almost certainly wipe the entire party unless they have the prescience
to cast Deafness on themselves before the encounter (and how would
they know to do that?) When he wipes them, he will of course trap
their souls and they will go into his gems to die within 24 hours.
However, I have a narrative save planned.
After getting trapped in the gems, it seems to them they are floating
around in infinity for a very long time, vaguely aware of themselves
but losing grasp of the idea of their own existence. Suddenly, the
soul delirium ends as without warning, they pop back into the Material
Plane (and their old bodies) in an explosion of light and color. They
are outside, laying on their backs in the broad daylight. They blink
up into the sun to see Durnan standing over them with a warmaul. It
turns out that Durnan has been following their adventures all along
through a spying object that he gave the characters at the beginning.
When they entered the Tomb of Horrors, he recognized the place from
lore and knew the legend of Acererak. He set out to find them and
rescue them and did so just in the nick of time, an hour before their
time was up and they would have been lost forever. Defeating the
demilich, he teleported up to the surface with the gems and smashed
them, setting the players free. If the characters ask him how he
defeated the demilich all by himself, he is vague about it. The truth
is, Durnan is an Adult Gold Dragon who needs the help of some
epic-level adventurers for a later epic-level quest I've planned, and
it's in his interests to keep these adventurers alive until they gain
enough knowledge and experience to help him.