So yes, breaking glass may be cheaper, but your property will be exposed to thieves and you could lose much more than the locksmith's fees. Pretty stupid, but I had to do it with a friend once. We were in a very remote rural area and, even though we had two cars, it would have taken us almost a whole day to get the mobile signal, call a locksmith and take them to the mountains to open the car. Breaking the small half window of a back door was undoubtedly the best option on that occasion. In short, the reasons for breaking a window instead of with a traveling locksmith are very few and far between.
When you run out of access to your home or vehicle, it's natural to wonder if you should break a window or call a locksmith. However, in the vast majority of cases, always opt for a mobile locksmith instead of breaking the window. Changing a lock key is cheaper than replacing it, as the locksmith only repositions the lock pins. Unless the lock is broken or stuck in some way, the locksmith won't have to forcibly enter by breaking the lock.
For the reasons mentioned above, it is evident that when you run out of access to your home, the best option is to call a locksmith instead of breaking the windows in the house. One of the reasons why people decide to break a window instead of calling a traveling locksmith (besides because they get scared or mistakenly think that it's cheaper to break a window) is that they think they can get in faster and leave broken glass as tomorrow's problem.