MDL-47006 core_grades: Fix handing of weight to aggregationcoef

Part of MDL-46576.