What are the karmic consequences of writing horror / fantasy fiction?
You reap what you sow. If your motivations was to frighten people Karmic consequence might be to be the author gets frightened also. If your motive is profit as expence of reader getting deluded, start craving, being lustful, being averse or frightened (aid the arising of the unwholesome roots) the expected karmic consequences may not be so good.

If your motivation is to send a constructive message then it might not be bad Karma after all. It might not be the ending that matters buy what motivates you to do it. 

Perhaps a book to teach Karmic consequence in the lower realms may not be a bad idea after all if you are thinking about writing. Khuddaka Nikāya's Petavatthu (and even perhaps Vimānavatthu) section may be a motivator for such stories.

Also the working of Karma is complex so it is not possible to give a definitive answer.