The current two ejection functions both rely on the implicit assumption that you need your hyperbolic excess velocity to match the deltaV required for a Hohmann transfer in both magnitude and direction. However, it does not take into account the fact that KSP uses patched conic approximations and therefore gravitational influence of the smaller body ceases to exist when outside of the sphere of influence. This means that the angle will be slightly greater than the optimal angle (due to leaving the planets sphere of influence before velocity is co-linear with the asymptote of the hyperbola).