The iPhone battery replacement program offered a significant price reduction at the end of 2017. The plan was to provide a solution for users with an iPhone 6 or later model who were experiencing battery life issues. It was such a beneficial measure for users that it ultimately ended up impacting Apple itself.
Too many repairs do not help sales

You already know what's happened with the new iPhone XS and iPhone XR . Sales of the new devices haven't reached the estimated figures, and the manufacturer is being forced to lower the price of the iPhone XR to improve sales and clear out stock. Besides being more expensive than many users expected, it seems the reception of the new devices has been influenced by the current condition of the models many users already owned. Thanks to the battery replacement program, they were able to extend the life of their old devices, thus postponing the purchase of a new phone.
It's been like having the enemy within. Tim Cook himself confirmed this in the letter to investors explaining the poor sales of the new models, and today we finally know which numbers may have led Apple to this rough patch. As we can see on Daring Fireball , John Gruber's blog, the total number of batteries replaced reached 11 million units, an incredible figure that has undoubtedly affected the brand.
A $29 solution that generates losses

Imagine you have an iPhone from a couple of generations ago whose battery isn't performing very well, and you're offered the chance to replace it at an official store for just $29. You can do that and practically have a new phone, or buy the new iPhone XR for a little over $800. What would you do? To give you an idea of ​​what Apple might have lost, what would have happened if 25% of the people who replaced their batteries decided to stick with their old iPhones? Well, Cupertino would have missed out on $2.200 billion in revenue. It's that simple. We can't know exactly how many iPhone XS and XR units weren't sold because of this decision, but it gives us a sense of how it might have influenced the current situation.
Let's remember that the battery replacement solution was a measure almost imposed on Apple after it was confirmed that the brand decreased the performance of its devices when the battery deteriorated over time. If the phone was running slow and poor, the user would get day one performance just by changing the battery, hence many could have kept their phone for another generation. This ugly strategy was not fined by any organization, but it seems that a year later the brand has somehow paid for it.