If I understand your question correct you want to reach something like in this plot?.
you start to throw the ball from different heights , you want th reach the same distance , holding the start velocity constant and changing the shouting angle.
if so here is the solution:
the trajectory of the ball is :
$$y={\frac {\sin \left( \varphi \right) x}{\cos \left( \varphi \right) }
}-\frac 12\,{\frac {g{x}^{2}}{{v_{{0}}}^{2} \left( \cos \left( \varphi
\right) \right) ^{2}}}+y_{{0}}
\tag 1$$
where $~y_0~$ is the start height
substitute into Eq. (1) the required range $~x=x_r$ , from here you can obtain with $~y(x_r)=0~$ the required angle $~\varphi_r~ $ holding the start velocity constant.
$$y(x_r)=0={\frac {\sin \left( \varphi _{{r}} \right) x_{{r}}}{\cos \left(
\varphi _{{r}} \right) }}-\frac 12\,{\frac {g{x_{{r}}}^{2}}{{v_{{0}}}^{2}
\left( \cos \left( \varphi _{{r}} \right) \right) ^{2}}}+y_{{0}}
\tag 2$$
from the solution of Eq. (2) you obtain $~\varphi_r=\varphi_r(x_r,v_0,y_0)$
Edit
you can also get this results.
you start with different heights , all of the projectiles reach the same height and the same distance, but you have to verify the initial velocity and the initial angle .