The lesson is this: a real physical circuit has R, L and C elements. The voltage source* and capacitor circuit is a fiction, adequate to explore conservation of charge, but completely inadequate for any other aspect -- such as time or frequency behavior, or energy or power balance.

*Or capacitors of different charge, or any combination. Two capacitors in series, with some initial voltage on one, is equivalent to one capacitor of series equivalent value, plus one voltage source equal to the difference in initial voltages.

The case with just L and C (no D) is actually identical to the C and C case, if you separate the solution properly:

With no D, of course, the resonant wave continues on forever -- the diode simply stops it at a convenient point, turning the resonant energy into potential energy (capacitor final voltage and charge). If we leave it resonate instead, then we have a mean value on the capacitor, equal to the voltage source, and therefore the mean charge as well. And if we look at the energy in the capacitor, it's also oscillating up and down, with the average equal to the half charge value. Presto -- we've separated the energy components into a oscillating component, and a static component! The oscillating component, obviously, has equal energy -- it's oscillating up and down with amplitude equal to the average. If we calculate the energy of that sine wave by itself (Parseval's theorem), we find the same answer again.

Incidentally, if you try simulating this, you may find the sine wave grows or shrinks over time, even with all components carefully set to zero ohms resistance. This is a consequence of numerical stability: it's very hard to calculate something with quite that much accuracy, when you're doing it incrementally, one tiny step at a time! This isn't a bad illustration of it actually, and getting a feel for how it varies with the various TOL parameters, and integration method (simulation settings).

Tim