Years ago, when I was first married, we bought our first home in California 40 miles away from our work. We were able to buy a large home at half the cost it would have been just 20 miles closer to work. The end result was a 90 minute commute in bumper to bumper traffic, which we did for 8 years. It was miserable. During the winter, I left my home in the dark and I came home in the dark. I did not see our home during daylight hours except on weekends. We did not know how miserable it really was until we no longer had to do it with a job transfer, when we bought our second home.
This is a common story. There are many people around the world who commute 60 - 90 minutes or more each way to go to work whether driving, or taking public transportation usually trains in those regions that have them. At least on the train you can read or nap. The question is whether the trade off of buying a bigger home at a lower price is really worth it. Certainly, for people with families that need more space, it may be the only option. However, there is no doubt that it impacts quality of life.
That is why when Covid hit and many people were given the option of working from home, they jumped on it. So much so that now that they have been able to work from home, many are fighting going back to the office. A lot of this has to do with commuting time, which in many cities is 60 - 90 minutes each way. Fighting bumper to bumper traffic is stressful. Certainly, after we moved and my commute fell to 30 minutes each way, I knew I would never take a job again that required long commuting distances.
So when considering a home purchase, factor in both the cost of commuting in terms of time and money. Just maybe it makes more sense to buy a smaller home closer into work if you are still required to go into the office. The best of all worlds is the ability to work from home because then you can live virtually anywhere in the country.