My point was that the concentration of the chemicals is not subject to the organisms internal state, and is also basically one dimensional. But my mental model predicting things is subject to the internal state of my dopamine levels, as well as very high dimensional. Pretty sure the math is a lot simpler in the first case. You will get a lot of quasi-periodic and chaotic behavior from the internal model. So bumping up the dopamine a little could easily cause period doubling or quite different, quite non-linear variations. If your gradient descent is walking a high dimensional system with non-linear dynamics, especially in a range where you are getting close to phase changes (e.g. fight or flight), it won’t be a simple little bacterium swimming to the food.
Yeah that's where you go from a linear to a nonlinear system, and why the associated discipline is called complexity science. It's still just an extension of the same concept into high dimensional space, but attractors in high dimensional space can be a lot less intuitive than 2d ones.
So the mathematics are a lot different and more complicated in the get thru a day as a human case than chemotaxis. Results of stability and convergence of a given control system that work for the linear case can easily fail for the non-linear case. And so while these straightforward maximization systems exist in the human brain, the case for this structure analogized from driving flagella to increase the chemical concentration outside might not be a universal model for human cognition overall.