In studying literature there is a general precedent that the main heroes aren't supposed to be killed, because the reader bonds with them. this dates back to greek epics, etc.
however in Shakespearean drama there is this kind of thing.
usually the doomed characters have fatal flaws, which are hinted at earlier.
there is such a thing as too much tragedy, which leaves nowhere for the plot to go afterward except into a completely incoherent mess which is the rest of the story unfortunately.