“Sunk costs” effect:

When you choose to do or continue something just because you have invested (unrecoverable) resources in it already, even if it’s untenable or unhealthy to continue. Understand when it’s time to cut your losses and walk away.