Personally I don't think Canon did anything wrong. In the consumer market they may appear to be behind Sony (I only mention them since they make Nikons sensors), but you have to remember they have many other ventures. They make security cameras and those huge megapixel sensors that they show off are the types of products that will get them government contracts for surveillance and make them big money which is probably where a lot of their focus is.
In this day and age being a segment of a larger company is a negative, not a positive. As you point out, Canon makes a lot of money in other sectors. As soon as the optical sector stops performing, there is a high likelihood that it gets sold or torn apart for it's value. The only thing keeping it alive is that it is still making money. As an example, look at Motorola. It use to have a solid auto, semiconductor, mobile phone, and network sector as well as public radios. All were sold and not the company is a shell of its former self and they are not the only example.