I do this all the time.
Whenever I get bored with writing my stories, or angry at something in real life, or any of a number of things, I'll kill a character. Instantly makes me feel better, and provides me with an interesting situation to write my way out of. I once got all the way to 85,000 words of a 100,000 word novel, and then decided to kill the main character. Then I had his sidekick and love interest win the battle and then part ways because he was all that was holding them together as a team.
And it was much more interesting than the original ending would have been.
Then again, Ron shouldn't have died. Although I wish that there had been some way to kill Emma Watson without killing Hermione Granger. (I haven't had a chance to rag on old EW in ages, thanks for giving me another opportunity.)