Sunk costs are often a predictor of a developed position.
For example, you spend 20 years in advancing in field and then worry that you might not like it that much anymore.
If you avoid leaving the field purely because of the sunk time, you are honoring a sunk cost.
If you avoid leaving the field because your 20 years have made you good enough at it that your pay is good and your job stability is assured... and meanwhile you would have a hard time getting hired in a new preferred field or keeping a job there because your expected pay would be unaligned with your experience there (see also: ageism)... then that is just playing the hand you are currently holding.
Usually your current position isn't completely clear. You don't know precisely to what degree 20 years experience have made you better suited to your past field than another.
Under the reasonable assumption that your past costs weren't entirely wasted and aren't perfectly fungible to different moves it is reasonable to use your past costs as a predictor of your current position. 20 year experience in a field is probably worth something, and probably worth a lot more than 5 years.