In general, when you have one method that works and are trying to understand the error of an alternative method, you can often use the working method to examine the assumptions you made in the other method, and that in turn can often help you to pinpoint the error.
Here, you make the assumption about the relation of the maximum height the projectile attains, $h_{\text{max}}$ to the projection angle $\theta$ and the range $d$. So you can check what is the correct relation by using the method that you know is correct.
For example, one way that you can find the maximum height is by energy conservation:
$$ \frac{1}{2}mv_i^2\sin^2\theta = mgh_{\text{max}}$$
$$ h_{\text{max}} = \frac{v_i^2\sin^2\theta}{2g}$$
Now the time to reach maximum height is given by:
$$ v_{fy} = 0 = v_i\sin\theta-gt_{\text{top}}$$
$$ t_{\text{top}}=\frac{v_i\sin\theta}{g}$$
By symmetry of the parabolic path, the entire distance is covered in twice that duration. So:
$$ d = v_i\cos\theta \cdot 2t_{\text{top}} = \frac{2v_i^2 \sin\theta\cos\theta}{g} \qquad (\ast) $$
Now if we calculate $\frac{1}{2}d\tan\theta$, as you suggested:
\begin{align*}
\frac{1}{2}d\tan\theta &= \frac{1}{2}\frac{2v_i^2 \sin\theta\cos\theta}{g}\tan\theta
\\ &= \require{cancel}\frac{v_i^2 \sin\theta\cancel{\cos\theta}}{g}\frac{\sin\theta}{\cancel{\cos\theta}}
\\ &= \frac{v_i^2\sin^2\theta}{g}
\end{align*}
Which turns out to be precisely $2h_\text{max}$. This isn't surprising, the height of a right triangle with angle $\theta$ and base $d/2$ is higher than the actual height attained by the projectile, because the projectile would follow a straight line only in the absence of gravity (and would never descend).
We see however that it would be correct to write:
$$ h_{\text{max}} = \frac{1}{4}d\tan\theta $$
So the actual maximum height attained by the projectile is half the height of a right triangle with base $d/2$ and base angle $\theta$. This is actually a well known result, as you can see for example here.
It's nice to note that there is no mention of $g$ in this relation. The effect of $g$ is embedded in the value of $d$; a stronger gravitational acceleration will reduce $d$ and vice versa. In fact you can see that when $g\rightarrow 0$, the expression given in $(\ast)$ gives $d\rightarrow\infty$. As the gravitational acceleration vanishes the maximum range extends without bound.