SMD capacitor damaged - use of X2 class
Considering you are applying a low loss 2k source R to a 50k Load with a nominal input  of 339Vp to a 250V 0.1uF ceramic cap, it is no wonder that it failed.  The only choice here is an X2 rated film cap which attenuates 1kV To 3kV lightning transients as per your unstated CE requirements.   

Start with worst case power &amp; transient specs, then your choices become clear using your regional power standards.