To reproduce the problem:
- Add a few grade items to a course
- Set the aggregation to "Sum of grade"
- Set to Aggregate only non-empty grades
- Set user report setting "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
- Hide one of the grade items
- Enter grades for a user only for the visible items
- View the user report for the user. You will notice that the course total is not accurate. It should be a sum of the entered grades, but it is grater than that.
Item 01 - 50/100
Item 02 (hidden) - empty
Item 03 - 50/100
user report shows a course total of 150 rather than the expected 100.