The following test results in UB:
The $subtract is performed with [<some date>, Infinity]. This causes this conversion to long long. This cast is UB when the truncated double is a value that can't fit in a long long (such as Infinity).
We may want to change the implementation of Value::coerceToLong() and audit existing calls to it in case there are similar bugs.