while calculating the energy stored in a capacitor of capacitance C to charge up to a voltage $V_{0}$ we say that the work done is move a infinitesimally small amount of charge $dQ$ from the negative plate to the positive an external agent has to do $(dQ) V$ amount of work which is equal to $(\frac{Q}{C})\,dQ$ which is than stored as potential energy of the capacitor Taking the integral from $ 0\, to \,Q_{0}$ bears $$\int_{0}^{Q_{0}} \frac{Q}{C}\,dQ\, = \frac{Q_{0}^2}{2C} = \frac{1}{2} C V_{0}^2$$
While finding the energy stored in the capacitor we make the same argument again just with the capacitance being $\kappa C\,$ instead of just$\, C$ .So the energy stored would be $$E=\frac{1}{2} \kappa C V_{0}^2$$
Now suppose at some certain instant the charge on the capacitor plates is $Q$ so the charge induced at the dielectric surface is $Q_{p}=Q(1-\frac{1}{\kappa})$ thus if $dQ$ charge moves through a potential difference $\frac{Q}{\kappa C}$ while moving from the negative plate to the positive plate also a $dQ(1-\frac{1}{\kappa})$ amount of charge suffers a potential difference of $- \frac{Q}{\kappa C}$. So the total change in potential energy is $$dU=dQ \frac{Q}{\kappa C}-dQ(1-\frac{1}{\kappa })(\frac{Q}{\kappa C})= $$ $$dQ\,\frac{Q}{\kappa^2 C}$$ $$\int_{0}^{Q_{0}} \frac{Q}{\kappa^2 C}\,dq\, = \frac{Q_{0}^2}{2\kappa ^2 C}=\frac{1}{2}CV_{0}^2$$ But before it was found to be $\frac{1}{2}\kappa C V_{0}^2$
where is the problem? Is there any other kind of internal energy not being considered?