Farrell signed for six years, and apparently was pursuing other offers when the 7th season was offered. She decided to accept an offer for a new comedy series, where she worked another four years. We don't know why she left DS9. Maybe she wanted to do comedy. Maybe the hours were better, with fewer all-nighters. Maybe she was offered more money. Maybe she had the hots for Ted Danson.
The producers had a choice of keeping Dax alive for possible guest appearances (no guarantee Farrell would be available), and bringing in a completely different and unrelated character to replace her. Or they had the option of sacrificing Jadzia and moving the symbiont into a new character, a science fiction opportunity.
Once they decided to kill Jadzia, I would have preferred the Dax character being killed off completely, giving Sisko a double loss. I have no objections to Nicole DeBoer, and she could have become a completely different non-trill character.