You have to provide the following information whenever possible.

**Describe the bug**

Interval data type is not passed correctly from subquery

**Does it reproduce on recent release?**

Yes, tested on 21.6.5.37.

**How to reproduce**

```sql
SELECT
    toIntervalDay(5) AS interval,
    now() + interval AS res

┌─interval─┬─────────────────res─┐
│        5 │ 2021-07-03 13:11:45 │
└──────────┴─────────────────────┘
```

But if I wrap interval calculation in subquery:

```sql
SELECT
    (SELECT toIntervalDay(5)) AS interval,
    now() + interval AS res

Received exception from server (version 21.6.5):
Code: 70. DB::Exception: Received from localhost:9000. DB::Exception: Conversion from Int8 to IntervalDay is not supported: While processing CAST(5, 'IntervalDay') AS interval, now() + interval AS res.
```

**Expected behavior**

Both queries should work the same way.
if (!skip_not_null_check)
                {
                    const auto & col = arguments[0].column;
                    const auto & nullable_col = assert_cast<const ColumnNullable &>(*col);
                    const auto & null_map = nullable_col.getNullMapData();
                    if (!memoryIsZero(null_map.data(), 0, null_map.size()))
                        throw Exception{"Cannot convert NULL value to non-Nullable type",
                                        ErrorCodes::CANNOT_INSERT_NULL_IN_ORDINARY_COLUMN};
                }
                const ColumnNullable * nullable_source = typeid_cast<const ColumnNullable *>(arguments.front().column.get());
                return wrapper(tmp_args, nested_type, nullable_source, input_rows_count);
            };
        }
        else
            return wrapper;
    }
    
    
    WrapperType prepareImpl(const DataTypePtr & from_type, const DataTypePtr & to_type, bool requested_result_is_nullable) const
    {
        if (isUInt8(from_type) && isBool(to_type))
            return createUInt8ToBoolWrapper(from_type, to_type);
        
        bool safe_convert_custom_types = true;
        if (const auto * to_type_custom_name = to_type->getCustomName())
            safe_convert_custom_types = from_type->getCustomName() && from_type->getCustomName()->getName() == to_type_custom_name->getName();
        else if (const auto * from_type_custom_name = from_type->getCustomName())