This is a quirk of the SQL engine that powers our queries. When a calculation (such as SUM) is performed on multiple decimal types with different values, the values are coerced to a common type and rounded off. Negative values in particular may result in a loss of precision -- and produce different query results with each run.
To prevent this, we recommend adjusting your order so the cast function is performed before the calculation.
For example, this clause may produce inconsistent results:
SELECT
CAST(SUM("XY"."X") AS DECIMAL(1,1)) AS "X"
But this clause will produce the same result every time:
SELECT
SUM(CAST(("XY"."X") AS DECIMAL(1,1))) AS "X"