Answer
The API expects a decimal-typed number, and a workflow variable populated from a prior step can end up holding a plain integer instead — explicitly convert the variable to a decimal value in a script task before passing it into the API call (for example, wrapping it as a BigDecimal, or assigning it with an explicit decimal literal) rather than passing the raw integer-typed variable straight through.