Presumably, you would like the reverse EMF from the projectile moving through the magnetic field to provide the majority of the load voltage in the circuit and be large enough that the current continues at over half its max until the projectile makes it out of the barrel.

If the projectile is too large, then you will get all of the energy out of the capacitors, but the slower motion will result in a lower back EMF, and consequently most of the energy will be dissipated resistively, probably mostly in the arc between the rails and the projectile.

If the projectile is too small, then almost all of the power in the circuit will be reactive, but the projectile will leave the barrel while the capacitors are still mostly charged.

Calculating this is somewhat complicated by the fact that the voltage across the projectile will be highest as it leaves the barrel, because that's when it's cutting the maximum amount of magnetic flux per millisecond; but that's exactly the point where the voltage across the capacitors is lowest, since that's when they stop discharging.

Maybe you could remedy this problem by using a flywheel-driven homopolar motor instead of capacitors. Failing that, probably the best you can do is discharging the capacitors to something like half voltage, transferring three fourths of their energy into the arc and the projectile.

Your two arcs, assuming a length on the order of millimeters, are going to suck up minimally 50 or so of your volts, which is one reason to use higher voltage — so that the relatively fixed voltage drop across the arcs doesn't hurt efficiency so badly.

https://en.wikipedia.org/wiki/Tesla_%28unit%29 suggests that the maximum field you can reasonably expect to achieve across the rails is on the order of 500 milliteslas. If you were going to keep using 400 volts, discharged down to 200 at the time of exit, then the optimum would be to have a back EMF at 500 milliteslas of about 150 volts at whatever the muzzle velocity is. 150V / (500 mT * 20mm) = 15 km/s, about Mach 45 and about twice the speed of, say, the International Space Station.

Okay, so if we have, say, 15kJ of projectile energy at 15 km/s, how massive is the projectile? 15 kJ / ((15 km/s)²/2) = 130 mg. One difficulty with this is that small, light projectiles slow down more from air resistance, which is significant when you're talking about flying fast enough to suffer ablative erosion from turning the air in front of your projectile into plasma.

So, you're right. 22 grams means that the capacitors finish discharging far too early, so almost all the energy would be dissipated in the resistance of the arc. Except actually I think most of it ends up in the flapping cables, which weigh a lot more than 22 grams. You could probably get a noticeable improvement in the penetration just by tying the cables to boards so they can't flap around and generate so much back-EMF of their own. (They'll still generate a significant amount due to self-inductance, which you can reduce but not eliminate by tying the opposite-direction cables very closely together.)

But wait! What if the magnetic field is weaker? Achieving 500 milliteslas is pretty hard, after all. MRI machines have a field on the order of a tesla, which creates hazards of its own, though that's mostly due to the field being distributed over a large volume. If it's only 50 mT, then you need the projectile to be going ten times as fast to build up that same 150 volts of back-EMF: 150 km/s. And that, in turn, means that your sweet-spot weight goes from 130 mg to about 40 mg.

You could improve the situation for massive projectiles, at the expense of arc losses, by using a lower voltage and higher capacitance. And of course a stronger magnetic field would help too, but I don't think that's very practical.

I don't know, maybe I've missed something in my calculations here. You'd think that barrel length would enter into it somewhere, for example.