When this was first implemented, my colleague Phil Butcher spent a lot of time comparing the numbers Moodle calculated with independently calculated correct values.
And, there is an automated test of these calculations, so we would konw if something unexpectedly changed and broke the calculations. The test data for that is here https://github.com/moodle/moodle/tree/master/mod/quiz/report/statistics/tests/fixtures (in a rather cryptic format).
If you are sure that the calculations are wrong, please try to make the simplest possible example that shows the bug (e.g. can you make it happen on a quiz with 2-3 questions and 3-5 attempts?) If so, please give us specific details. Thanks.