**Describe the bug**
https://clickhouse-test-reports.s3.yandex.net/22534/0733144b4a355394fecb837ba01af76a50e3fa05/fuzzer_debug/server.log

**How to reproduce**
`SELECT emptyArrayToSingle(arrayFilter(x -> (x != inf), arrayJoin([[1024], []]))) FROM system.one ANY LEFT JOIN (SELECT dummy, [257], NULL, dummy AS value) AS js2 USING (dummy) GROUP BY emptyArrayToSingle(arrayFilter(x -> (x != 1.), arrayJoin([[]])))`

{
        res.resize(s);
        for (size_t i = 0; i < s; ++i)
            res[i] = i;
    }
    void updatePermutation(bool, size_t, int, Permutation &, EqualRanges&) const override {}
    ColumnPtr replicate(const Offsets & offsets) const override
    {
        if (s != offsets.size())
            throw Exception("Size of offsets doesn't match size of column.", ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH);
        return cloneDummy(offsets.back());
    }
    MutableColumns scatter(ColumnIndex num_columns, const Selector & selector) const override
    {
        if (s != selector.size())
            throw Exception("Size of selector doesn't match size of column.", ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH);
        std::vector<size_t> counts(num_columns);
        for (auto idx : selector)
            ++counts[idx];
        MutableColumns res(num_columns);
        for (size_t i = 0; i < num_columns; ++i)
            res[i] = cloneResized(counts[i]);
        return res;
    }
    void gather(ColumnGathererStream &) override