The sunk cost fallacy is a cognitive bias that makes you feel as if you should continue pouring money, time, or effort into a situation since you’ve already “sunk” so much into it already. This perceived sunk cost makes it difficult to walk away from the situation since you don’t want to see your resources wasted.
When I took an economics class in college, the idea was broached that it could be possible for finishing a degree to be a sunk cost fallacy, if you realized that the degree didn't benefit you or wasn't a good use of your time midway through finishing it, and the effort you already put into it shouldn't be a consideration. This was a very unpopular idea and most students in the class refused to believe the Sunk Cost fallacy is a real fallacy.
Yes, that's a good example for something that follows the rational use case. But let's not take a toxic relationship extreme, I think in the case of a human relationship, the sunk cost may sometimes positivly contribute to the affection/intimacy/love. The sunk cost created memories, habits, foundations for a relationship that you cannot just suddenly ignore and only look at what comes in the future.
I think one must be careful about applying rational principles telling you to not listen to your emotions to subjects where reason doesn't play the main role.