**Describe the bug**
ClickHouse is unable to detect syntax error in expression: `SELECT if(CAST(NULL), '2.55', NULL) AS x`, which leads to a failure.

**How to reproduce**
* Reproduces in 20.7, 20.8 version of ClickHouse
* Queries to run that lead to unexpected result

**Expected behavior**
A clear message, indicating there is a syntax error in the above expression (CAST(NULL) is not a valid logical expression).

**Error message and/or stacktrace**
The original AST-fuzzer report - https://clickhouse-test-reports.s3.yandex.net/12550/48333b29f619490fd1df50230301596e44e2af45/fuzzer/fuzzer.log#fail1

Server error log - https://clickhouse-test-reports.s3.yandex.net/12550/48333b29f619490fd1df50230301596e44e2af45/fuzzer/server.log
type_literal->value.get<std::string>() == "UInt8")
                        return tryExtractConstValueFromCondition(expr_list->children.at(0), value);
                }
            }
        }
    }
    return false;
}
void OptimizeIfWithConstantConditionVisitor::visit(ASTPtr & current_ast)
{
    if (!current_ast)
        return;
    for (ASTPtr & child : current_ast->children)
    {
        auto * function_node = child->as<ASTFunction>();
        if (!function_node || function_node->name != "if")
        {
            visit(child);
            continue;
        }
        visit(function_node->arguments);
        const auto * args = function_node->arguments->as<ASTExpressionList>();
        if (args->children.size() != 3)
            throw Exception("Wrong number of arguments for function 'if' (" + toString(args->children.size()) + " instead of 3)",
                            ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
        ASTPtr condition_expr = args->children[0];
        ASTPtr then_expr = args->children[1];
        ASTPtr else_expr = args->children[2];
        bool condition;
        if (tryExtractConstValueFromCondition(condition_expr, condition))