One monster of a CR equal to the PCs' average level isn't supposed to make more than a speedbump draining a few resources from the PCs.
If you look at the adventuring day XP budget (DMG p. 84), then a lvl 6 PC should gain up to 4k XP over a hard day's adventuring. So between them, something like 16k XP. And the Mummy Lord is 13k XP. The CR went against them, being so much higher, but other than that it was a close fight. Sounds like the CR/XP system works more or less as intended. This was pretty much a day's worth of fights in one big battle.
Edit: Btw, good on you and your group. They might have pulled this off, and they would've remembered it with satisfaction for years, all the more so because it was so frustrating at the time. Excellent RPGing there all around.