This is literally a Shakespearian plot. The King feared the heroes destroying the kingdom and upsetting the balance of the world, so he murdered them, only to seal the fate of the kingdom and the world in doing so, having created the very threat he feared. This is a revenge story done correctly. This is high fantasy, proper mythic fantasy, like something from the lore of a video game that you never get to see, except now we are seeing it happen, we get to watch that process.
And some of you autists are still crying about it and saying it's not good enough. UGH SUCH A STUPID PLOT.
Then stop reading it, and please, please, stop commenting. Do both of those things. Go away.