Optimizing for absence of failed stores would be an interesting utility function for them to have, but since they own substantially all of the stores (and therefore don't have franchisee relationships to consider, where volatility for a partner might impact you disproportionately to economic loss), that would be a suboptimal utility function. They should calibrate their risk appetite to maximize profits; occasional failed stores are just a search cost.
A market commenter who believes that Google is not one of the most sophisticated engineering organizations in the world is wrong. If you believe Walgreens is not one of the most sophisticated commercial real estate operations that exist, I would encourage you to talk to people who understand real estate as well as you understand Google and recalibrate based on what they tell you.
MacDonalds is similar. If they have a franchise that is doing badly, they will pay to move the franchise to a new location. A suburban McD closing is rare, usually only the oldest ones on lots that are too small for contemporary usage patterns.
You can have 0 failed stores if you open 0 stores. A successful operation will inevitably have failed stores. Having a long list of failed stores doesn't mean anything in of itself. You have to look at the rate of failed stores vs successful stores among other metrics.
Starbucks in 2019 is the McDonald's of coffee shops, so it's not the same, but if you track their Starbucks Reserve locations you'll find the same predictions being used.