I replaced iPhone batteries in family and friends phones more than 20 times. It's only about $15 and 10-20 minutes of work. Some after market batteries don't last year even a year, some are good for 2 years.
I don't think the battery was bad though, but instead the new iOS version being more power-hungry given the new models and chipsets coming out every year. The new battery was already at 92% health only 4 months after it was installed, which was a bit surprising for me.
At this point I just accepted that it was at the end of its lifespan.