Tail recursion optimisation gets rid of all tail calls in functions, not just those that might lead to loops - you cannot in general detect those calls that might be loops. This can put a lot of holes in your stack trace.
It's an optimisation. It can be turned off when debugging with stack traces. If you need stack traces in production code, you have too many partial functions.