I really dislike the phrasing attached to this story.
It's not a lock: a third party installed battery still works, the phone isn't refusing to start up until you go to an Apple Store and have an authentic Apple(tm) battery installed. Rather, it's a warning in the "battery health" section basically saying "we don't know if your battery is any good, you might need to get it replaced".
That said, I'd prefer a clearer phrasing of their error message. It looks like it's just triggering the generic "your battery may need service" warning, which is more of a scare tactic than I'd like. "You don't have a certified Apple battery" would be completely sufficient.
Given the existence of refurbishment scams, where substandard parts are put into old phones to make them look good briefly, I can understand where Apple is coming from on this point. Someone who buys a second-hand iPhone and finds the battery dies after a month isn't going to be very happy with iPhones.