Defensive check against unknown TaskEndReason.