**Describe what's wrong**

```sql
SELECT toTypeName(s), toString(s) FROM
(
 SELECT toFixedString('',32) AS s 
 UNION ALL
 SELECT null AS s 
)
```

this query works in all versions from 19.17 to 21.8, but stop works after 21.9+ 

https://fiddle.clickhouse.com/7bd65b36-a6e6-470a-8bdc-4c98a33ff453
21.8 works

https://fiddle.clickhouse.com/9e40a424-4027-4c7f-bd41-b20935ae9129
21.9 doesn't work
```
Received exception from server (version 21.9.6):
Code: 44. DB::Exception: Received from localhost:9000. DB::Exception: Illegal column Nullable(FixedString(32)) of first argument of function toString. (ILLEGAL_COLUMN)
```

this query works in all versions

```sql
SELECT toTypeName(s), toString(s) FROM
(
 SELECT '' AS s 
 UNION ALL
 SELECT null AS s 
)
```
https://fiddle.clickhouse.com/4f810f03-1644-4eb7-b696-0341b1bbdbc4


**Does it reproduce on recent release?**
Yes, reproduce in all releases 21.9+
}
            return createTupleToMapWrapper(from_kv_types, to_kv_types);
        }
        else if (const auto * from_array = typeid_cast<const DataTypeArray *>(from_type_untyped.get()))
        {
            const auto * nested_tuple = typeid_cast<const DataTypeTuple *>(from_array->getNestedType().get());
            if (!nested_tuple || nested_tuple->getElements().size() != 2)
                throw Exception{"CAST AS Map from array requeires nested tuple of 2 elements.\n"
                    "Left type: " + from_array->getName() + ", right type: " + to_type->getName(), ErrorCodes::TYPE_MISMATCH};
            return createArrayToMapWrrapper(nested_tuple->getElements(), to_type->getKeyValueTypes());
        }
        else if (const auto * from_type = checkAndGetDataType<DataTypeMap>(from_type_untyped.get()))
        {
            return createMapToMapWrrapper(from_type->getKeyValueTypes(), to_type->getKeyValueTypes());
        }
        else
        {
            throw Exception{"Unsupported types to CAST AS Map\n"
                "Left type: " + from_type_untyped->getName() + ", right type: " + to_type->getName(), ErrorCodes::TYPE_MISMATCH};
        }
    }
    WrapperType createTupleToObjectWrapper(const DataTypeTuple & from_tuple, bool has_nullable_subcolumns) const
    {
        if (!from_tuple.haveExplicitNames())
            throw Exception(ErrorCodes::TYPE_MISMATCH,
            "Cast to Object can be performed only from flatten Named Tuple. Got: {}", from_tuple.getName());
        PathsInData paths;
        DataTypes from_types;
        std::tie(paths, from_types) = flattenTuple(from_tuple.getPtr());
        auto to_types = from_types;