I don't think it would have hurt the story. If anything it would have made it مزید interesting. Even though I wouldn't want to see Hermione یا Ron die and thank the gods it didn't happen. It would be interesting to see how Harry would react and how much مزید he would want to avenge his دوستوں deaths and fight even harder to prove they didn't die in vain.
Harry Potter is a kids' story. It'd have hurt the story if one of the golden trio died, obviously. There were sacrifices anyhow: Moody, Tonks, Lupin, Sirius, Dumby, Fred etc. We did see how Harry reacted when his دوستوں died for him, I don't think it was any of Rowling's purposes when writing the story that we should see and feel through the personal tragedy of the main character. The whole story is about the good winning against the bad, the bonds of friendship, the importance of loyalty and love. If one of them died, it'd be all in vain یا would take 7 مزید کتابیں to prove otherwise. After all, the golden morals of JK would be destroyed. It'd be quite morbid to kill Harry himself, when we started off from his childhood age, and killing Ron یا Hermione would only cause مزید sorrow and ruin the happy end. None of that is a purpose of this series. The usual fairy tale scheme with the Happily Ever After air is what belongs to a story like Harry Potter's. Especially that it's not just his, but Ron's and Hermione's story too.
I think it would depend on who died when - if Harry died in any book except the last, the کتابیں would hit a dead end. There wouldn't be anything to hope/live for, Voldemort would win, etc. If Hermione died during any one of the books, nobody would have a clue as of what to do next. "Harry, should we read that book, یا تلاش this one?" "Ron, how do آپ pronounce this spell?" I'm sad to say, if Ron died, the کتابیں could have gone on. Hermione would have been sad, possibly depressed, but that's about it. It would just give Harry one مزید thing to live for.
Oh my gods! How DARE آپ even suggest such a thing?! Of COURSE it would affect the story! Now take back your curse, آپ foul, evil thing! "Now go away یا I shall taunt آپ a سیکنڈ time.". Awesome French Dude From Holy Grail.