In machine learning the cost function is static and is defined by a smart person working hard to come up with something sensible. In life, the cost function changes constantly and is developed consciously as well as subconsciously. Indeed, the training examples (previous experiences) will influence the dynamically evolving cost function.
Moving along the gradient in a ML framework means that every refinement of the framework will influence cost non-positively, while in life we often act in ways that decrease utility.
Also, to put it bluntly, life is just a lot more complicated than that.
The homeless problem is not all about drug abuse and that idea is harmful because it's used as an excuse to ignore it.
Everyone knows that they need to have life goals. Even addicts know that they are optimizing the wrong thing.
And the thing that is missing in AI today is the back-and-forth conversion of correlations to causal relationships, which, yes, humans are not that good at, generally don't consciously do, but have a built-in mechanism for.