**Does it reproduce on recent release?**
Reproduced on 21.11.1.1 (master) and 21.9.2
Works as expected on 21.8.2, so it's regression

**How to reproduce**
```
:) create table mt (id Int64, A Nullable(Int64), X Int64 materialized coalesce(A, -1)) engine=MergeTree order by id
:) insert into mt values (1, 42)  -- X will be 42 (as expected)
:) insert into mt select 1, 42    -- X will be -1
:) select *, X from mt order by id
┌─id─┬──A─┬──X─┐
│  1 │ 42 │ 42 │
└────┴────┴────┘
┌─id─┬──A─┬──X─┐
│  1 │ 42 │ -1 │
└────┴────┴────┘
```

**Expected behavior**

```
:) select *, X from mt order by id
┌─id─┬──A─┬──X─┐
│  1 │ 42 │ 42 │
└────┴────┴────┘
┌─id─┬──A─┬──X─┐
│  1 │ 42 │ 42 │
└────┴────┴────┘
```

const Block & block, const String & required_column_name, DataTypePtr required_column_type,
    const ColumnsDescription & columns, ASTPtr default_expr_list_accum, NameSet & added_columns, bool null_as_default)
{
    checkStackSize();
    bool is_column_in_query = block.has(required_column_name);
    bool convert_null_to_default = false;
    if (is_column_in_query)
        convert_null_to_default = null_as_default && block.findByName(required_column_name)->type->isNullable() && !required_column_type->isNullable();
    if ((is_column_in_query && !convert_null_to_default) || added_columns.count(required_column_name))
        return;
    auto column_default = columns.getDefault(required_column_name);