What will happen if I use higher voltage capacitors in an inverter?
Nothing will happen, it is fine to use higher voltage capacitors than the previous capacitors. The voltage rating indicates the max voltage. If the capacitor has a higher max rated voltage, then that's fine, because the product will have an operating voltage lower than 400V.
Check the ESR in the datasheets and make sure its lower than the current capacitors.