Conversion error: query returned null, binding needs "double"

@Slurpee, fallback is useful in case no values are returned (zero rows). While in your case, the SUM function always returns exactly 1 value; Null in case there is no data in your selection.

Also see this thread from a few days ago: SQL Query error handler?
Similar situation, but with the MAX function instead of SUM.