Small SMD components: are they really capable of withstanding high voltages?
When deciding the voltage rating of a 'component on a board' system, you need to define what sort of rating you mean. Safety critical is much more stringent than simply working.

For instance, the withstand voltage on a clean dry board will be much higher than the rated personal safety voltage on a dirty board in a damp salt-laden atmosphere.

If the component is rated at 500v, then you can assume that the component itself, under conditions that the manufacturer specifies, will withstand 500v.

Would an 0805 footprint meet the creepage clearance regulations for separation between mains carrying and low voltage tracks, for personal safety? No. However, 'mains' is expected to have transients of at least 1500v on it, which is why capacitors for mains connection are specifically rated for such, see X and Y rated capacitors. For a regulated 500v, in a dry environment, when personal safety is not an issue, then there's no problem supporting 500v across an 0805 footprint.

If you are intending your PCB+components system to be used in a dirty damp environment, then you may well need a conformal coating to mitigate board surface contamination problems, even if you don't have to meet saftey rated creepage distances.