The new R package ohun allows to do exactly that (diagnose the performance of detection routines).
https://marce10.github.io/ohun/index.html
It takes a reference table and the detection output and returns a bunch of performance metrics, including number of true positives, false positives, false negatives, precision and recall. It also provides some time related metrics like the amount of overlap to true positives.
I am still working on it so would be happy to hear suggestions for new features.
Edit: to echo @lostanlen, the python package sed_eval for evaluating (diagnosing) sound event detection. It has lots of cool features to evaluate segment-based and event-based detection