At a guess, all the series L-C sections are causing phase shifts and causing the instantaneous A * V power calculations to give confusing results.
A bad power factor, in other words; current and voltage significantly out of phase. (Why transformers etc. are rated in "VA" rather than Watts),
Also, using AC sources to represent batteries seems rather strange? There will be phase interactions with the input supply causing odd readings.
A battery will only take charge current above a certain voltage, regulated or limited by both it's internal resistance and the external source voltage and resistance.
I'd represent the batteries with either a 12V Zener and series resistor, or a DC supply with a low value parallel resistor to carry the "charge" current (lessening the load on its directly connected supply as charge current increases).
All dissipated power is +ve and generated power is -ve. Thus Net phasor sum of energy is zero over an integer number of cycles, as all power is accounted for including that stored in LC reactors as no energy is destroyed.