When a custom or site-wide scale is used in "Sum of grades" aggregation, Moodle assigns incorrect point values to those given the highest rating in the scale. Hence students may be inadvertently assigned incorrect grades when scales are used by the instructor. I have verified that this error occurs for both custom and site-wide scales, regardless of how many levels are established by the scale.
A series of screen shots showing the problem is attached for reference (see the course total for the last "student").
To reproduce the problem:
1) Set up a custom scale in an empty gradebook... I used "Unsatisfactory,Satisfactory,Outstanding" - should be valued as 1, 2, 3, respectively.
2) Create a "Grade item" that uses the scale.
3) Set the course total aggregation to "Sum of Grades."
4) Rate "students" using each of the possible values of the scale.
5) Note that the aggregated score for student(s) rated at the most positive level is incorrect (that student's rating is incorrectly given the value of the next-to-highest rating instead of the highest).
(A more complex scale, using values F, D-, D, D+,... , B+, A-, A treats ratings of A (presumably worth 12 points) identically to those rated A- (worth 11 points.)