My view is purely utilitarian. All my life as an organizer I’ve had to wrestle with positive versus negative thinking, as each has its benefits. In the end, I did research which confirmed my suspicion that each has its role and function.
Negative thinking is used for dealing with specific and immediate problems. It tends to focus attention over the short term. The weakness of negative thinking is two-fold. First, it is extremely toxic to the body; the risk-factor of early death associated with negative thinking is something like five times that of smoking, largely as a result of the effects on the body of chronic stress reaction. Second, it keeps attention focused entirely on what’s happening in front of you, preventing any kind of long-term planning.
Positive thinking is used for seeing the big picture, planning strategically, and avoiding pitfalls which may require negative thinking to escape. The weakness of positive thinking is where I actually address your question. Repeated psych studies have shown that people who are depressed are markedly better at solving problems involving judgement, such as estimating whether a given shape will fit a given hole. Non-depressed people err constantly on the side of optimism. This supports the hypothesis of depressive realism which holds that the function of depression is to provide an individual with the most accurate possible information for dealing with a serious existential problem which might be otherwise insoluble.
The utilitarian view, then, is that hope becomes delusional when it stops working. When the long view stops being able to avoid pitfalls, then switching to negative thinking is necessary.