Connecting two capacitors in parallel
The problem here is that connecting two capacitors with different charges will result in an infinite amount of current and this is the basic problem in analysing the circuit. If you introduced a small resistor (call it the switch contact resistance), you can derive a formula that predicts the final voltage across the capacitors. 

But energy will be lost in the resistor so, using the formula you can assume R gets progressively smaller and smaller and for each reduction in R you will find that the initial current gets bigger and bigger and you should be able to notice that the \$i^2\$R.t loss does not actually get any smaller - it approaches a constant value and the smaller R gets you'll find that the energy loss remains the same. This indicates the final energy loss.

Please consider that you can't short the two capacitors together and hope to get sensible results by just assuming that the initial individual energies stored in each capacitor will equal the final energy once they are in parallel. This doesn't happen in the real world and it won't happen in the theoretical world either.