You’re making it out to be far simpler than reality. McDonald’s is more than just an ice cream place, they sell Big Macs, fries, a clean place with wifi, and cheap coffee. It would have to be the sum of those worse off than a competitor.
A bad ice cream machine could just mean sub optimal profits / experience.