Wikipedia on depressive realism, the theory that those with depression are free from the “optimism bias” that skews most people’s perception of the world:
Depressive realism is the proposition that people with depression actually have a more accurate perception of reality, specifically that they are less affected by positive illusions of illusory superiority and optimism bias.
Studies by psychologists Alloy and Abramson (1979) and Dobson and Franche (1989) suggested that depressed people appear to have a more realistic perception of their importance, reputation, locus of control, and abilities than those who are not depressed.
SOURCE
Depressed people may be less likely to have inflated self-images and see the world through “rose-colored glasses” thanks to cognitive dissonance elimination and a variety of other defense mechanisms that allow [individuals] to ignore or otherwise look beyond the harsh realities of life.
This does not necessarily imply that a specific happy person is delusional nor deny that some depressed individuals may be unrealistically negative.