NAN means "Not a Number".
Most likely, due to rounding of the specific implementations of the tangent and arccosine functions in your calculator, the actual result is some very tiny Pure Imaginary Number - really close to the zero (0) you were expecting.