Actually, the very existence of the Xpan is a good demonstration that companies don't have to follow the dominant market trends with their products. It was destined to be a niche of a niche from the beginning, but they still saw value in creating it. Such a strategy means that the item will not be a massive hit, but it can be successful by catering to the sort of people who appreciated why it was different. If I wanted to focus on panoramic images, it would be a top priority to purchase even today, and I'm curious enough about it that I would probably try one out if I were wealthier, something I can't say for the various giant DSLRs. To my understanding, the Xpan was reasonably successful (within the confines of the limited expectations its makers would have had to start with), ultimately being discontinued because of EC lead regulations making re-engineering not worth it. Similarly, Leica delivers rangefinders, digital and film, to the people who prefer rangefinders. As long as there is a market of people wanting rangefinders and M-compatibility there, I don't see why Leica would benefit from a "move away from the rangefinder M" following up the 240.
On the comparisons of Leica to other companies and the strategies/success of those companies, be they Apple, Ferrari, or whatever, it's dangerous to put too much weight on any oversimplified narrative. There is a lot of research out there about changing/emerging markets and the best strategies to employ, and it's pretty clear that there aren't really generally applicable rules. The right move in one circumstance can be precisely the wrong one in another. Focusing on core business can be a good move, as can innovation that cannibalizes core business. It's not that drawing a parallel isn't appropriate, but one should keep in mind that companies and markets have details that make them distinct to go with those details that make them similar to others.