Some of us are trying to optimize for things other than happiness. An occasional bit of happiness can be a nice side effect of certain types of optimization but happiness isn't a reasonable goal to focus on by itself.
Happiness is a valid goal. If one perceives it’s not reasonable to expect it, then you may arrive at this conclusion. But imo that’s because we short-circuit happiness to sources of pleasure that we see aren’t that reliable.
Hell, even this settling for happiness as a side-product is a result of the judgement that this is the best we can do regarding the goal of happiness.