One problem is people usually think about RMS voltage because that is what we talk about but the diode is looking at peak to peak so the one you thought was safely bigger than it needed to be is really getting close to the spec. Peak = 1.414 x RMS (call it 1 1/2 times and you won't get in trouble). Put your safety factor in after you do that. A 400v diode is barely large enough for 240vac