BIGINT UNSIGNED value is out of range
The subtraction (-) causes the error.  It is pessimistic.  You are stuck with using CAST(... AS SIGNED) to avoid the error.

SHOW VARIABLES LIKE 'sql_mode';


See if it includes NO_UNSIGNED_SUBTRACTION

For 'rationale', it may be best to quote some (of many) bug reports on the topic:

https://bugs.mysql.com/bug.php?id=61410 :


  This is intentional change in behavior in 5.5. For those who needs this kind of statements to work and produce meaningful (unlike in pre-5.5) results, there is NO_UNSIGNED_SUBTRACTION SQL mode (http://dev.mysql.com/doc/refman/5.5/en/server-sql-mode.html#sqlmode_no_unsigned_subtractio...).


https://bugs.mysql.com/bug.php?id=46799 :


  http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html
  
  Subtraction between integer values, where one is of type UNSIGNED, produces an unsigned result by default. If the result would otherwise have been negative, it becomes the maximum integer value. If the NO_UNSIGNED_SUBTRACTION SQL mode is enabled, the result is negative. 


https://bugs.mysql.com/bug.php?id=21070 :


  "Warning: When you use subtraction between integer values where one is of type UNSIGNED, the result is unsigned unless the NO_UNSIGNED_SUBTRACTION SQL mode is enabled. See Section 12.8, “Cast Functions and Operators”."