Is this reproducible? If not, I don’t think there’s much you can do to work out after-the-fact what happened. If it is reproducible though, then you can do things like force ninja to build non-parallel and then the last task before ninja stops will be the one that is failing. A command like ninja --verbose -j1 would get you there.
If you can’t reproduce it, my guess would be a failed custom command that doesn’t report anything if it fails.