Consider a block sliding without friction on a wedge as in the following picture:
Given the height of the block of mass $m$ as a function $h(t)$ of time $t$ with initial height $h(0) = h_0$, is the following method to determine the acceleration of wedge $M$ correct?
Using conservation of energy, the initial potential energy of the block is equal to the final kinetic energy plus potential energy after a time $t$: $$mgh_0=\frac{1}{2}m(v_1\cos(30^\circ)-v_2)^2+\frac{1}{2}M(v_2)^2+\frac{1}{2}m(v_1\sin(30^\circ))^2 +mgh(t),\tag{1}$$ where $v_1$ is the velocity of the block in frame of the wedge and $v_2$ is the velocity of the wedge w.r.t ground. Using conservation of momentum in the frame where the ground is at rest, we also have $$m(v_1\cos(30^\circ)-v_2)=Mv_2\tag{2}.$$
The second equation looks perfectly fine to me as it just momentum conservation. However, the first equation might be incorrect. I applied this technique to solve this problem, which asks for the acceleration of the wedge if the block's height varies as $h(t) = 1.5\ \mathrm{m} + 1.5\frac{\mathrm{m}}{\mathrm{s}^2} t^2$. I solved for $v_2(t)$ from the two equations and then differentiated it to get the final result. The answer I get using this technique (putting $M=m=1$ as the result is independent of mass) is $3 \mathrm{ms^{-2}}$. However, the correct result should have been $\frac{2}{\sqrt{3}} \mathrm{ms^{-2}}$. I'm certain that there is no trivial calculation error. I've checked it several times.
So, why is equation (1) not applicable in this case?