The fight on the roof after finding Nightsong
Thats the first fight ...
Ah, the second and third parts of the battle are before and after he turns into the avatar of Myrkul. Sorry, my memory of that fight was a little hazy and I thought of those as two separate entities.
He probably just got some massive healing spell cast on him in the time it takes you to get down there - after all, it only takes 1 round to cast Heal.
Another good explanation that only swap one problem with another.
I mean sure ... he could heal ... shame he forgot how to do that for rest of the fight huh?

I specifically said "he
got a healing spell cast on him", i.e. it was cast by someone else. In fact, we know how he was healed after that first fight - he recaptured Nightsong.
You are missing the point ... he wouldnt be beaten bcs there is no way to heal meanwhile ... he would have missing HP in order to reflect your players effort!
They just finished fighting him, few minutes ago ... if he is now standing here in full strength, what purpose did that previous fight served? What was that for? Nothing thats what.
BUT!
If you instead get his HP from his both phases together ...
You completely change how it whole feels.
Right now you have:
You killed him (0HP, you know that) > except you didnt ... he run ... you find him > you killed him again (0HP, you know that) > except you didnt ... he transforms ... you killed him again > congratulations he is finaly dying.
Instead you would get:
You beaten him a lot ... he run ... he is beaten, since you beaten him previously > you beaten him even more ... he transforms in furtile atempt to destroy you at any cost ... you kill him (0HP, you know that).
Doesnt that feel better?
It does to me.
I disagree with a lot of what you're saying about that fight, and I recognise that people can enjoy a video game in different ways and that's fine, but I think we're seeking different things from this game. It looks to me like you're focussed more on the combat, and you want to have a clearly set out goal and know what you've got to achieve in each battle, whereas I'm playing for the story and characters, and the purpose of the combat is to serve that story; and therefore for me it was fun when the game threw out a twist I wasn't expecting.
So no, I don't think it would have been better if the game had told me in advance the total number of HP he had in all three battles, or if it had told me that the battle would be in three phases. For me, that sort of surprise is fun and ramps up the tension. I like to imagine what the party is thinking at that point, suddenly having to decide whether to go after him, and if they can afford to rest to recover. Yeah, I'm sure it doesn't make any difference to the next battle, but deciding "we can't let him get away, we'll have to make do with a Song of Rest and press on, get those scrolls ready in case we run out of spell slots" is part of the story for me that wouldn't have happened without that first phase.
Talking about wasted effort, the result would have been exactly the same if you'd killed Ketheric on the top of the tower, and then a cutscene played showing you that you needed to go to the basement where you'd fight two separate bosses, one of which could be the avatar of Myrkul. Why would that be more satisfying than Ketheric pulling off an escape? Assuming that there isn't a bug that allows him to actually die before the escape, but then again, our D&D games often allow major villains to get death saves.
Hitpoints are a bit of a weird mechanic because they can't represent an exact amount of injury. We say 'hit' or 'miss' because it's easier, and RPG video games animate hitting or missing, but the first few times you hit an enemy you're not driving a sword into their chest. I saw someone describe hitpoints in tabletop games as an abstraction of your stamina wearing down, then getting minor wounds, and then the last couple of hits would be major injuries. I guess from there it's not too hard to see the hitpoint bar not as the amount of injury it takes to kill an enemy, but the amount of attacks needed to complete the current task. There are loads of games where reducing an enemy to 0HP usually kills them, but major bosses end up panting on the floor while they give a monologue. Sometimes it
is cheap when a game takes away an enemy that you thought you'd defeated, but I thought this one was done well. Maybe that's the quality of the writing, maybe it's just what I put into it.