So let's do the thought experiment of connecting a charged and a discharged capacitor in parallel at t=0s.
May I suggest an alternative thought experiment?
Assume lossless capacitors and conductors. Assume two capacitors of equal capacitance, C. Assume one of the capacitors is discharged. Assume that the other capacitor is charged to the exact value 1.602176634×10
−19 Coulombs (the charge on an electron). Assume that the charged capacitor has a voltage of 1V, equivalent to 1eV Joules of energy. When the switch is closed, the electron migrates from the initially-charged capacitor to the initially-discharged capacitor. The electron then migrates back to the initially-charged capacitor. Oscillation occurs. Is my alternative thought experiment valid?
If those two capacitors are identical (same capacity) the voltage after switch is closed will be 0.707 * Vi
I was thinking further with this idea of 70.7% of Vi per capacitor after the switch is closed and noted a disparity regarding the issue of time relating to current flow between the two capacitors and the voltages across the capacitors. If both capacitors are 1F and the charged capacitor is charged to 3V then the initial charge is 3 Coulombs.
If the initially-charged capacitor discharges from 3V to 2.121V then the change in voltage is -29.3% of Vi. If the initially-discharged capacitor charges from 0V to 2.121V then the change in voltage is +70.7% of Vi.
If both capacitors have 70.7% of Vi after the same time period has past then how did the initially-discharged capacitor charge up faster from 0V to 70.7% of Vi than the initially-charged up capacitor discharge from 100% to 70.7% of Vi? This would violate Kirchhoff's Current Law where the current flowing into the node is not equal to the current flowing out of the node. In this case the node is located between the capacitors.
The current flowing out of the initially-charged capacitor must be equal in magnitude to the current flowing into the initially-discharged capacitor. The initially-discharged capacitor would need to charge from 29.3% of Vi to 70.7% of Vi in a time period of zero seconds. This is impossible.
I have seen a similiar problem in a YouTube video.
https://youtu.be/q398AqtTEL8\$I = C \frac{dV}{dt}\$
\$I.dt = C.dV\$
Time taken for capacitor to charge/dischage to target voltage:
\$dt = C\frac{dV}{I}\$
For reference:
+70.7% \$V_i \approx \frac{V_i}{\sqrt{2}}\$
-29.3% \$V_i \approx \frac{-V_i{(\sqrt{2}} - 1)}{\sqrt{2}}\$