Should predictive analysis be tackled with causal inference in mind? Say I am trying to predict depression from anxiety. I collect data and build a MLE and obtain r=0.9. To me, this is great, so I push the model to production. 4 months later, I realise that the "rate of unemployment" is a confounder that plays on both variables.
I conclude that I should not merely look at correlation, but rather tackle predictive analysis from a causal inference perspective.
However, when learning about predictive analysis, I rarely see mention of causal inference. It is often just about "finding the best model to fit your model".

As Vladimir mentions, the answer is "it depends". If you build a well-calibrated correlational (i.e., predictive) model on units randomly sampled from your population, then that model should generalize to other members of the population. If you have a model of depression and anxiety, then applying that model to other units in the population will be accurate. The fact that there are confounding variables says nothing about the validity or generalizability of the model results (to the same population).
For example, if you calibrate a model well to predict depression participants' reported anxiety, the fact that there are confounders of that relationship doesn't affect the quality of the prediction when applied to new data. Of course, the presence of a confounder implies that there is a variable predictive of the outcome that you are missing, in which case your predictions would be improved if you included it in your model (the same as any prognostic variable).
Where you need causal inference is when you want to predict outcomes after (hypothetically) manipulating a feature. For example, if you manipulate participants' anxiety by giving them an anti-anxiety medication, your previous model for depression is no longer valid because the outcome and feature are confounded in the original data. Your model would need to account for all confounding factors and not condition on any confounding-inducing variables to be able to predict the outcome without bias. You need a statistical theory of causal inference to tell you which features to include and exclude in your model to arrive at an unbiased model for the outcome given manipulation of the treatment.
