Ice Cream products would be one of the last things they phase out.
First, the ice cream machine produces multiple products: milkshakes, McFlurries, hot fudge sundaes, and ice cream cones.
Second, dessert is an upsell and driver of APV. If you lack dessert options you basically leave money on the table from customers who are willing to buy dessert.
Third, the ice cream machine, despite its problems, is a pretty small and manageable piece of equipment. It doesn't need an employee to babysit it like a fryer or flat top. The only thing simpler at a McDonald's is the Apple Pie heater.
If you don't believe me, find a burger chain that doesn't have ice cream on the menu. Wendy's, Burger King, Shake Shack, Steak 'N Shake, In-N-Out, Whataburger, Culver's, Carl's Jr/Hardee's, seriously, which restaurant that serves burgers doesn't have ice cream/milkshakes?