Question on Effectiveness of Regression Model in Real World

The first example given in the course is around predicting house prices using Regression models. Given the prediction is based on past data how realistic is this. My concern is that this method looks like only focuses on mathematical correlation but ignores other factors such as external factors that could affect house prices such as impending, recession, war or what happened during COVID. Zillow a heavy user of ML models had to take a major loss in 2020/2021 because its models could not accurately predict the housing market. I am wondering what the practitioners recommend how to avoid such mistakes and what are some guidelines on what ML models can and cannot do. It seems to me that regression would work in fairly closed systems where the implicit assumptions on cause and effect are fairly known. I would love to hear from the community on their thoughts.

This is week 1 of an introductory course. It is only a simple example.