Then the market changed to "[Android] phones that are like the iPhone" and Nokia refused to compete in that market, going for the "[Windows] phones that are not like the iPhone"-market instead. And totally dominated it with a 90%+ market share.
But that market was tiny. And Nokia was size-wise geared to compete with Samsung and Apple. Cue massive collapse of business when expenses overtook sales.