**Describe the unexpected behaviour**

Union All in combination with joins breaks when upgrading to Clickhouse 20.5.2.7

**How to reproduce**
* Which ClickHouse server version to use: 20.5.2.7
* Which interface to use, if matters: HTTP (but should not matter)
* Non-default settings, if any (none that I am aware of)

Please see the following queries:

```sql
CREATE TABLE tableCommon (
	`key` FixedString(15),
	`value` Nullable(Int8)
) ENGINE = Log();

CREATE TABLE tableTrees (
	`key` FixedString(15),
	`name` Nullable(Int8),
	`name2` Nullable(Int8)
) ENGINE = Log();

CREATE TABLE tableFlowers (
	`key` FixedString(15),
	`name` Nullable(Int8)
) ENGINE = Log()
;

SELECT * FROM (
	SELECT common.key, common.value, trees.name, trees.name2
	FROM (
		SELECT *
		FROM tableCommon
	) as common
	INNER JOIN (
		SELECT *
		FROM tableTrees
	) trees ON (common.key = trees.key)
)
UNION ALL
(
	SELECT common.key, common.value, 
	-- Variant 1
	null as name, null as name2 
	
	-- OR Variant 2
	-- flowers.name, null as name2
	FROM (
		SELECT *
		FROM tableCommon
	) as common
	INNER JOIN (
		SELECT *
		FROM tableFlowers
	) flowers ON (common.key = flowers.key)
)
```

**Expected behavior**
The query should run without an error.

**Error message and/or stacktrace**
The query returns the following error:
```
ClickHouse exception, code: 171, host: my.clickhouse.host, port: 8080; Code: 171, e.displayText() = DB::Exception: Block structure mismatch in  function connect between Converting and Concat stream: different number of columns:

key FixedString(15) FixedString(size = 0), value Nullable(Int8) Nullable(size = 0, Int8(size = 0), UInt8(size = 0)), name Nullable(Int8) Nullable(size = 0, Int8(size = 0), UInt8(size = 0)), name2 Nullable(Int8) Nullable(size = 0, Int8(size = 0), UInt8(size = 0)) (version 20.5.2.7 (official build))
```

**Additional context**
As you can see, there is no data in play at all. The error message is generated just from the raw structure. The first and the second part of the `UNION ALL` work when running them on their own.

Commenting out the last `INNER JOIN` (the one with the alias `flowers`) makes the issue disappear. This would also mean that the `null as name, null as name2` is not the culprit here.

queue.push({ output_format, false });
    visited.emplace(output_format);
    while (!queue.empty())
    {
        auto * processor = queue.front().processor;
        auto visited_limit = queue.front().visited_limit;
        queue.pop();
        if (!visited_limit)
        {
            if (auto * limit = typeid_cast<LimitTransform *>(processor))
            {
                visited_limit = true;
                limits.emplace_back(limit);
            }
            if (auto * source = typeid_cast<SourceFromInputStream *>(processor))
                sources.emplace_back(source);
            if (auto * source = typeid_cast<RemoteSource *>(processor))
                remote_sources.emplace_back(source);
        }
        else if (auto * sorting = typeid_cast<PartialSortingTransform *>(processor))
        {
            if (!rows_before_limit_at_least)
                rows_before_limit_at_least = std::make_shared<RowsBeforeLimitCounter>();
            sorting->setRowsBeforeLimitCounter(rows_before_limit_at_least);
            
            continue;
        }
        
        if (auto * format = dynamic_cast<IOutputFormat *>(processor))
        {