Every engineer has good points about variable frequency drive (VFD) failure reasons. Some of the phenomenons occur more frequently and some are rarer.
The sizing of VFD is important. Also the application and demands of application should be studied carefully. In some case it might be better to use soft starter than use VFD. Thus VFD is suitable for wide range of applications, some parameters should be examined before installing VFD. Some of these parameters are e.g. Motor, is it suitable for VFD use. Cable length in and out of VFD. Environment, is there excessive humidity, dust etc. Most of these things have covered in earlier comments already very well.
I've seen VFD development for quite long period (more than 20 years). Maybe my memories from past are golden but, it appears like VFDs use to be more robust, what comes to contamination like dust etc. but there can be also logical explanation. As the size of VFD is getting smaller and smaller the gap between components are also getting smaller, and therefore all kinds of particles within VFD can cause damage. So dust, moisture etc. can be a big problem, if environment issues are not taken care of.
Other increasing problems with VFD are all kind of disturbances and interference. VFD itself is a big harmonic source, causing problems to other electronic devices and electric circuits. I have not experienced harmonics to be cause of failure, but poor groundings and other related type interference have been cause in many cases. Type of Interference depends also complexity of application and electric grid where VFD is used. In some cases VFDs can disturb each other such, that other can fail because of disturbance or noise from another VFD.
Many cases voltage spikes have been root cause of failures. Voltage spike damages appear to be quite common reason for failures. Of course it is always difficult to say afterwards the real reason of failure, without any facts, like measured data.
These are the most common causes for failures what I have witnessed over the years working with variable frequency drives.