https://clickhouse-test-reports.s3.yandex.net/19673/e7de5f34b1b3ae5d6d4e5d96ba0cd7c45acfb329/fuzzer_ubsan/server.log

**Describe the bug**
```
milovidov-desktop :) SELECT transform(number / 2, [0.5, 1.5], ['Hello', 'World'], '-') FROM numbers(10)

SELECT transform(number / 2, [0.5, 1.5], ['Hello', 'World'], '-')
FROM numbers(10)

Query id: f8c2646e-e234-41ae-85ef-7a452d4a2545

┌─transform(divide(number, 2), [0.5, 1.5], ['Hello', 'World'], '-')─┐
│ -                                                                 │
│ -                                                                 │
│ -                                                                 │
│ -                                                                 │
│ -                                                                 │
│ -                                                                 │
│ -                                                                 │
│ -                                                                 │
│ -                                                                 │
│ -                                                                 │
└───────────────────────────────────────────────────────────────────┘

10 rows in set. Elapsed: 0.003 sec. 

milovidov-desktop :) SELECT transform(number / 2, [1, 2], ['Hello', 'World'], '-') FROM numbers(10)

SELECT transform(number / 2, [1, 2], ['Hello', 'World'], '-')
FROM numbers(10)

Query id: 18b64dcf-983e-4653-a62b-5501e18314fd

┌─transform(divide(number, 2), [1, 2], ['Hello', 'World'], '-')─┐
│ -                                                             │
│ -                                                             │
│ Hello                                                         │
│ Hello                                                         │
│ World                                                         │
│ World                                                         │
│ -                                                             │
│ -                                                             │
│ -                                                             │
│ -                                                             │
└───────────────────────────────────────────────────────────────┘
```
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override
    {
        const auto args_size = arguments.size();
        if (args_size != 3 && args_size != 4)
            throw Exception{"Number of arguments for function " + getName() + " doesn't match: passed " + toString(args_size) + ", should be 3 or 4",
                ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH};
        const DataTypePtr & type_x = arguments[0];
        if (!type_x->isValueRepresentedByNumber() && !isString(type_x))
            throw Exception{"Unsupported type " + type_x->getName()
                + " of first argument of function " + getName()
                + ", must be numeric type or Date/DateTime or String", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
        const DataTypeArray * type_arr_from = checkAndGetDataType<DataTypeArray>(arguments[1].get());
        if (!type_arr_from)
            throw Exception{"Second argument of function " + getName()
                + ", must be array of source values to transform from.", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
        const auto type_arr_from_nested = type_arr_from->getNestedType();
        if ((type_x->isValueRepresentedByNumber() != type_arr_from_nested->isValueRepresentedByNumber())
            || (isString(type_x) != isString(type_arr_from_nested)))
        {
            throw Exception{"First argument and elements of array of second argument of function " + getName()
                + " must have compatible types: both numeric or both strings.", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
        }
        const DataTypeArray * type_arr_to = checkAndGetDataType<DataTypeArray>(arguments[2].get());
        if (!type_arr_to)
            throw Exception{"Third argument of function " + getName()
                + ", must be array of destination values to transform to.", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
        const DataTypePtr & type_arr_to_nested = type_arr_to->getNestedType();
        if (args_size == 3)
        {
            if ((type_x->isValueRepresentedByNumber() != type_arr_to_nested->isValueRepresentedByNumber())