Did it really fail? The fork, KaiOS, seems to do pretty well:
https://www.kaiostech.com/company/our-story/
They claim that they are on 160 million devices.
And based on this:
https://data.firefox.com/dashboard/user-activity
Firefox has about 220 million users at the moment.
So, I wouldn't say that FirefoxOS failed, it just failed in their hand.