Someone already posted the exact mistake you made, so I won't repeat it here. I do, however, have some general advice for tackling this type of problem.
As I think you realize, both of these answers should give you the same result if applied correctly. Since they both should be right, either the two of the answers you found are actually the same answer (i.e. the first might be reducible using trigonomic identities or other algebra) or you did something wrong in one or both of your derivations. It probably won't take you too long to determine that your answers definitely aren't the same. Just plug in a couple values of the angle and see that they don't happen to all turn out to give the same velocity.
There is a fundamental difference between your answers: one depends on the angle, and one doesn't. The question you should immediately ask is: "does it make sense for this velocity to depend on the angle?". The best way to tackle these sorts of questions is often to consider limiting cases of those variables. Looking at the limiting case as $a$ gets closer to zero (holding h constant) doesn't seem very revealing (at least to me), but taking the limiting case of $a$ going to $\pi/2$ is. As the block gets steeper and steeper, it gets thinner and thinner to maintain a constant $h$, and the block on top gets closer and closer to free-fall. As this happens, it should be clear that the block pushes less and less on the triangle, and gets more of the energy to itself, so indeed, it seems that the velocity of the bigger block should probably depend on the angle.
With this realization, if you hadn't already been told your exact mistake, your search for your mistake would be narrowed and you'd have a better idea of what you'd be looking for and more likely to solve the problem on your own.
This long-winded comment is probably less attractive than that short and sweet explanation of the mistake you made, but I think if you try to tackle problems in this manner, you will more sincerely improve your problem-solving skills and improve your physical intuition, so I hope that this is still helpful.