Switching frequency selection, employing the right gate driver circuitry with appropriate gate resistance value, noise immunity at the gate drive circuit, parasitic elements and their effects, the high frequency switching noise, appropriate gate drive voltages are all the vital factors to be considered while designing the IGBT Full bridge inverters.
The real field performance of the Full Bridge IGBT Inverter is completely dominated by those issues only, for any application.
The designer must ensure that all these factors are appropriately balanced with the right selection of components for IGBT Full bridge inverters. The onus is entirely on the deployment of the right components for the gate drive for satisfactory operation. Since the device is highly sensitive to a range of challenges, that could crop up during the filed operating conditions. The designer should foresee and carryout a good predictive fault analysis and simulations, before deploying those components, in order mitigate the high risk possibilities and avoid catastrophic failure rates.
If it works OK at 10 KHz but not at 40 KHz, then most likely, you'll need to increase your series gate resistor above what it was at 40 KHz originally. You can increase anywhere from 20% to 100% at a time until it works (but don't go too high--not much above about 100 Ohms). When you get a value that works, then you can start going back down in value towards the last value used until it again no longer works, then increase that value 15% to 20% for a safe margin. Using your scope, ensure that one of the lower gate drive signals is reasonable from Gate to Emitter. But be careful that you're scope channel ground can handle being connected to the emitter (5V above power Vminus) of one of the bottom IGBTs. If you wind up with a gate resistor value that gives you unreasonably-slow switching speeds, then you may have other layout or magnetics problems to solve.