Capacitor choice is largely a matter of losses, yes. The capacitance value needs to be large enough to keep the midpoint more-or-less-fixed, with low ESR and ESL also being important. Under some transient conditions the midpoint can (and will) move around, so it's important to keep derating in mind as well. 50% voltage derating is well within reason (using 400V caps with a total DC input of 400V, for instance).
For AC-application capacitors (i.e. film caps), the ESR is often implied in the dissipation factor datasheet parameter, which is the relationship between ESR (resistive loss) and reactance:
\$ DF = \omega C \cdot ESR = \dfrac{1}{Q} \$
\$ \omega = 2 \pi f \$
It will usually be specified at a given frequency, which allows you to calculate the ESR.
Electrolytic capacitors generally have large ESL by nature of their construction vs. film capacitors, limiting their usefulness at high frequency. Film capacitors also have some self-healing capability under dielectric breakdown scenarios which make them a 'robust' choice in half-bridge designs.
Where to start?
First, your HV unit is not a transformer. It is a high-voltage module. It puts out a pulsing high voltage.
So, the high voltage transformer was made to make arcs, and as such
does not allow ... a no-load situation.
You are correct. Your capacitor will store charge and will destroy your module. Furthermore, you have taken the input power specification, (and it would be nice if you would share with us where you got the numbers) of 18 watts at 4.5 volts, and then calculated an output power of 18 watts/20 kv, giving .9 mA. This is wrong. Input power does not equal output power.
You have also failed to notice the part of the description that reads
Work: Input voltage 1.5V ~ 3V can work for about 1 minute, the input
voltage exceeds 3V continuous work does not allow more than 30 seconds
In other words, you will not be able to run your unit for more than 30 seconds at a time. And it doesn't say how long you need to let the unit recover from 30 seconds operation, either.
Having failed to understand your HV unit, you have equally failed to understand your water capacitor. To begin with, ultrapure water is does not have an infinite resistivity. It is, in fact, 18 Mohm-cm. For your described capacitor, this amounts to ~ 2 Mohm. At 20 kV, that will require 10 mA which you cannot provide. You mention a "coating on the plates" which you believe will prevent current flow, but you do not describe it, and I hope you will forgive my suspicion that it may not work as you plan.
You speak of your desire not to break down the dielectric (the water) and then talk about how pulsing or AC voltages will avoid this. You seem to be unaware that the breakdown potential for pure water is ~3 MV/m. Since the spacing for your capacitor is on the order of 12.5 mm, the breakdown voltage will be ~ 37 kV, or twice your voltage, and you have no need to worry.
Given the dielectric constant of water (80), the effective capacitance of your capacitor will be ~ 100 pF. Since your module has a diode in its output, you are correct in thinking that you will get just a DC output, since there is no major discharge path. You cannot discharge your capacitor from the input side. Any such discharge mechanism would have to be synchronized with the HV pulses, and would have to withstand 20 kV. Such a circuit will be neither simple nor cheap.
Your selection of series resistor is very strange. Your calculation for voltage drop make it clear that you have used the input figure of 4.5 amps, and this has absolutely no application to the output.
So, overall, I have no way give you advice, except to suggest that you do something else. I don't see any instance where you seem to actually understand how your proposed circuit would work, or why, and that is not a good starting point.
Best Answer
You don't show the whole circuit, so it is impossible to give a precise answer.
Your upper PWM signal will need to be isolated from the lower one with a circuit that rejects up to 1000 V of common-mode signal at 50 kHz. An optocoupler might work, but you also have to provide power to it on the output side.
When you power this circuit up, the generated signals at the transformer may depend on the EXACT duty signal. Without feedback, you will be unable to regulate at 50 % overall, and the junction of C1,C2 will charge to the supply rail or GND, thus making the drive asymmetrical and unable to provide good PWM signals.
C3 cannot be charged to over the (peak-rectified) mains in this circuit. It will basically be a constant DC voltage unless the load power is significant w.r.t the lamp power.
It's high voltage and potentially lethal. If you do't know the basics, then you are working with very dangerous voltages and energy storage.