src/Entity/Entity.php
protected function getDateValueInstanceFrom($value)
    {
        if ($value === null) {
            return null;
        } elseif ($value instanceof DateTime) {
            return new DateValue($value->format('Y-m-d'));
        } else {
            return new DateValue($value);
        }
    }
protected function getDateValueInstanceFrom($value)
    {
        if ($value === null) {
            return null;
        } elseif ($value instanceof DateTime) {
            return new DateValue($value->format('Y-m-d'));
        } else {
            return new DateValue($value);
        }
    }
Use input $value and return a valid DateValue instance.

@param  mixed          $value
@return DateValue|null