I sort of agree with Marie about the Hollywood happy endings, but I have to repeat that these are kids books. I my opinion, the book has to have some kind of uplifting, happy ending, even if it is something bittersweet like the end of Charlotte's Web, which always makes me cry buckets, speaking of tears. If JK kills off Harry or one of the other favorite characters, maybe there will be some other place or way that they exist.
I've also heard other authors say that they didn't know what the characters would do, that once they started the story, it kind of takes off on it's own.