The story must stay true to the genre
Except when it does not. The genre is an easy way of managing our expectations, I am paraphrasing Neil Gaiman here, but when a cultural ephemera (novel/movie/series) does not stay true to its genre, we feel dissatisfied. A western without cowboys, or a science-fiction without any technobabble makes us feel something is lacking.
However, genre is not the end of the thing - novels that break the genre conventions, if written good, can even be better. Take the marvel universe vs. the boys. Both are, from a superficial perspective, superhero universes but one takes the genre norms and twists them. And becomes even more better.
The story must stay true to its own conventions, I believe. It should not switch goalposts nor invent arbitrary cop-outs, or god forbid, deus ex machina to let it loose itself from a storytelling deadend.
Rocks fall everyone is dead
is not a fun ending for anyone, not for the reader, not for the character but maybe for the writer. At least, s/he ends the story one way or another.