I think the key issue here is that death isn't a final thing for the demon king. If it was then one of the commandments would necessarily be the demon king. Being dead does not stop the commandments from serving the demon king right now so there is little reason to think that wasn't the case 3000 years ago. Basically, meliodas could have been fighting the demon king 3000 years ago in the same manner he is doing so today. With what we know we can't even rule out the demon king dying of natural causes long before meliodas even betrayed him.
Also consider the circumstances under which the 10 commandments were defeated. Where was the demon king at the time? Of course, dead for whatever reason. And the demon clan at the time had the upperhand when it comes to the war, that is why a huge effort by all clans was made to seal them. If the demon king is as powerful as we think and he was alive at any point before the demons were sealed it is kinda hard to see how they did not just own everything.
He was dead because Mel(alongside Dolor and Gloxinia) fought him, and Mel possibly killed him. Why would Dolor and Gloxinia even bother with the demon king, if that didn't happen right when the Holy war started? So it is like I said, that Mel rebelled against the demon king, and later on killed him. Whether he can come back or not is not relevant. We can't say that Mel would have fought the demon king, if he was already dead, and that couldn't have happened before his betrayal, before the Holy war, because Mel was still with the demons back then.
So it must have happened after the Holy war started, which is the direct result of Mel's betrayal. And it was stated that the Goddess clan got the other clans to join them, in trying to defeat the demons, so Dolor and Gloxinia's involvment with Mel, and them confronting the demon king, is tied to the Holy war.
It's not too hard to figure out, Mel betrayed the demons for whatever reason, then he went on and fought the demon king alongside Dolor and Gloxinia before they joined the demons.Actually it's quite possible they died in the war and met the demon king in purgatory, and were converted by him.But it's very possible Mel succeeded in defeating the demon king and killing him, which is why he's in the purgatory right now.
Then the demon king cursed Mel, so he can restore his power by feeding on Mel's emotions. Because why would he curse him if he didn't die by his hand, and he didn't need to find a way to restore his power?
Does that make sense to you? . Because there's absolutely no reason for Mel to fight the demon king if the latter was already dead.And logically such a fight would have only happened after Mel's betrayal, not before.
So everything points out to Mel not just fighting the demon king and surviving to tell the tale, but that he actually succeeded and killed him .
After Mel defeated the demon king, he could have colluded with the Goddess clan to seal the demons. I never said the seal would have happened while the demon king was still alive.So it's likely the demon king was taken out first, by Mel. Then the seal happened.