There is no universally applicable answer, it is totally dependent upon the specific VFD specifications. For some drive mfrs, they make a 400V "Class" drive for 380-415V systems, a 500V Class drive for 440-480V systems, a 600V Class for 550-600V systems and a 690V class for 690V systems. Nobody makes ALL of those different classes however, so everyone has different interpretations of how that is handled, if at all. The only people who can answer this question is the specific VFD mfr involved.
When diodes, transistors and IPMs are made, they test them for different maximum voltages. Because the testing for 600-690V causes the highest number of rejects and the 400V class will comprise the vast majority of demand, they leave those for last. Failed devices are scrapped, so to decrease that loss they test units for the 690V range first and if they pass, they sell those at a premium for the lower market demand of the 600-690V devices. Then they test what's left for 500V class ranges and when that demand is satisfied, they leave the rest for 400V class testing. So will a 400V class device pass for 500V or even 600V? Maybe, but it has NOT been tested for that, only because there was no need to. The demand for that high voltage class was already met before the 400V class device was tested, so it was only tested at the maximum input on the 400V class in order to decrease the losses in scrapping failed units.
But in the real world, a VFD mfr may, internally, only really buy two classes of components, 500V and 690V. They may SELL the 500V rated devices in 400V class drives at the lower price point, then take a premium for the 500V class when they can. So if YOUR drive is of that ilk, the mfr may tell you to go right ahead, no problem at all. But if your VFD mfr truly focuses on the 400V marketplace and therefor uses only the cheaper 400V class devices, they will not likely accept any responsibility for the drive being damaged by applying 500V to it.