Depression is a "freeze" reaction to stress, effectively shutting down to avoid triggering a dangerous response from the environment.
To me this seems quite a stretch, and maybe some conflation with "learned helplessness".
In my experience, depression is an irrational fear reaction. When something good happens, the brain suddenly thinks "this is not good, failed, it's worthless, a waste of effort" or "this was a mistake; this is going to end in disaster for me, I shouldn't have done this." It's not adaptive just because it's occasionally a correct prediction by chance.
A more common adaptive reaction to adversity is carefulness/stress: heightened awareness of the world and intense effort to choose safe decisions, and to fantasize ways to escape.