if you use the trace anoyhow, you can read out the normal vector of
the surface that was hit.

Do several traces to the front in different angles,
get the normal vector, and make an weighted average of them.

if you turn your model 90 degrees to the normal vector
you have the same effect.


Your current method assumes a very steady / flat terrain,
if some obstace comes, the angle can jump quite quickly.


---

if the math in your calculation for the angle is correct, you can
check on paper.
if the values differ from what you have in the engine,
you probably uses some math function with the
wrong parameters.