**Describe the bug**
https://clickhouse-test-reports.s3.yandex.net/19387/fb268ec339aeb2cbab0df5137ead3efb8374cc32/fuzzer_debug/server.log

**How to reproduce**
```
SELECT avg(diff) FROM (SELECT * FROM (SELECT learnerHash, passed - eventTime AS diff FROM statements GLOBAL SEMI LEFT JOIN (SELECT learnerHash, argMax(eventTime, resultScoreRaw) AS passed FROM (SELECT learnerHash, eventTime, resultScoreRaw FROM statements WHERE (courseId = 1) AND (onCourse = 1048575) AND (verb = 'http://adlnet.gov/expapi/verbs/passed') AND (objectId = 'https://crmm.ru/xapi/courses/spp/1/1/0-1') ORDER BY eventTime ASC) GROUP BY learnerHash) USING (learnerHash) WHERE resultScoreRaw AND (courseId = 1) AND (onCourse = 0) AND (verb = 'http://adlnet.gov/expapi/verbs/interacted') AND (eventTime <= passed) AND (diff > 0) ORDER BY eventTime DESC LIMIT 0 BY learnerHash) ORDER BY diff DESC LIMIT 7, 126)
```

Looks like query is based on `00586_removing_unused_columns_from_subquery.sql`.

MergeTreeBaseSelectProcessor.cpp:331

```
            auto & ctn = block.getByName(prewhere_info->prewhere_column_name);
            ctn.column = ctn.type->createColumnConst(block.rows(), 1u)->convertToFullColumnIfConst();
```

Looks like `prewhere_column_name` has type Float64.
{
    /** Find aggregation keys (aggregation_keys), information about aggregate functions (aggregate_descriptions),
     *  as well as a set of columns obtained after the aggregation, if any,
     *  or after all the actions that are usually performed before aggregation (aggregated_columns).
     *
     * Everything below (compiling temporary ExpressionActions) - only for the purpose of query analysis (type output).
     */
    auto * select_query = query->as<ASTSelectQuery>();
    auto temp_actions = std::make_shared<ActionsDAG>(sourceColumns());
    if (select_query)
    {
        NamesAndTypesList array_join_columns;
        columns_after_array_join = sourceColumns();
        bool is_array_join_left;
        if (ASTPtr array_join_expression_list = select_query->arrayJoinExpressionList(is_array_join_left))
        {
            getRootActionsNoMakeSet(array_join_expression_list, true, temp_actions, false);
            auto array_join = addMultipleArrayJoinAction(temp_actions, is_array_join_left);
            auto sample_columns = temp_actions->getResultColumns();
            array_join->prepare(sample_columns);
            temp_actions = std::make_shared<ActionsDAG>(sample_columns);
            NamesAndTypesList new_columns_after_array_join;
            NameSet added_columns;
            for (auto & column : temp_actions->getResultColumns())
            {
                if (syntax->array_join_result_to_source.count(column.name))
                {
                    new_columns_after_array_join.emplace_back(column.name, column.type);