the sunk cost fallacy is simply considering existing loss when deciding on continued investment (in time, money and other resources), when you should only consider future cost for future benefit. it's thinking erroneously that existing loss is not already locked in, that it's salvageable somehow. but no, it's already lost.
in a project with continuously updating probabilities of success, and under imperfect information, the go-or-no-go decision should only be based on the likelihood of future gains exceeding future losses, not future+existing losses.
in this framework, persistence would be having credible evidence (e.g., non-public information), not just belief, of the likelihood of future net gain relative to opportunity cost. it'd be irrational to be persistent simply on belief rather than credible information and probability estimation.
After is working on repairs, and after significant investment time and money, you are not as far along as you thought you would be. You update your calculations on time and cost based on your progress so far and any new problems you have uncovered.
A persistent person looks at the costs of a fixer upper, sees it is still likely worth doing, and is willing to put in the additional effort they had not originally planned for to see the project through. But they can also look at the future costs, recognize that the house is likely a money pit and continued work would be unlikely to ever yield a return on their investment, and that the time and money they have already spent are gone no matter what, but that they can prevent additional loss.
Someone biased by the sunk cost fallacy sees both projects the same. They look at the money pit and see that it is unlikely to show a return, but they hold on to the time and money they have already spent being lost if they walk away from the project, influencing them to continue.
To look at it another way, a persistent person would make the same calculation of the likely success of a project regardless if they came into it at the first point or the second point. They are persistent, so they won’t give up on something because it is more difficult than they originally thought and they won’t give up on worthwhile work just because it is hard. Someone biased by the sunk cost fallacy will not make the same calculation after they have invested effort, as they will hold on to already invested effort as a reason in and of itself to continue.
You can't go back in time and not work hard on something, so whether or not you should continue is purely a function of whether or not you think you will succeed, not a function of how much effort you've already put into it.
And here's the answer: Persistence is good when it is successful. If the activity us unsuccessful, it's an example of the irrational sunk cost fallacy. (Making decisions without knowledge of future events is quite hard.)
And the important lesson: If you bail at the first sign of adversity, no one can ever accuse you of being irrational. Of course, as the old saying goes, all progress is made due to the irrational.