Curate, connect, and discover
ok so your first problem was assuming mdzs is a story where Good People are Rewarded and Bad People are Punished.
your second problem was assuming that MXTX—who goes out of her way to showcase unresolved, tragic, undeserved endings in all of her works—would ever write a story with such a shallow notion of “deserving.”
the only reason wangxian makes it out unscathed is because they’re literally the protagonists. authorial intent and plot armor ensure their happy ending. that’s it.