Your Key IDs are 16 charcters wide. That means that SUMIF/SUMIFS evaluation engine (the thing that lets you use criteria like "<0" or ">="&A2) is trying to convert your 16 character faux numbers into real numbers.
Since you are 1 digit over the 15 digit precision that Excel offers, all of those faux numbers are being treated as the first 15 digits and a zero. e.g. 1000161100005542 is being evaluated as 1000161100005540. Since anything with the same
first 15 digits will match, your SUMIF/SUMIFS results are elevated due to the false positives.
For literal interpretation of 16+ digit faux numbers, use SUMPRODUCT. However, it is best to avoid full column references or you will experience calculation lag.
If your quantities are in column A then,
=sumproduct((A$2:INDEX(A:A, MATCH(1e99, A:A)))*(B$2:INDEX(B:B, MATCH(1e99, A:A))=D6))
If your quantities are in column B then,
=sumproduct((B$2:INDEX(B:B, MATCH(1e99, B:B)))*(A$2:INDEX(A:A, MATCH(1e99, B:B))=D6))