Throw an `OutOfBoundsException` in case of an invalid date (see #5086)