The 5c flopped because of other reasons: it was artificially made worse than the 5s. It started with 8GB memory that was already WAY TOO LITTLE back then, it had no touchid, it had a bad camera and so much more - and yet, the price was high. Apple learned from the mistakes and changed their segmentation strategy and it worked since then (with the exception of the weird XR thing).