**How to reproduce**
Clickhouse version 21.5

```
cat /etc/clickhouse-server/users.xml
<?xml version="1.0"?>
<yandex>
    <!-- Profiles of settings. -->
    <profiles>
        <!-- Default settings. -->
        <default>
            <data_type_default_nullable>1</data_type_default_nullable>
            <load_balancing>random</load_balancing>
        </default>
....

2021.04.04 01:23:42.453678 [ 29048 ] {} <Error> Application: DB::Exception: Nested type Array(UInt64) cannot be inside Nullable type: Cannot attach table `system`.`crash_log` from metadata file /var/lib/clickhouse/metadata/system/crash_log.sql from query ATTACH TABLE system.crash_log (`event_date` Date, `event_time` DateTime, `timestamp_ns` UInt64, `signal` Int32, `thread_id` UInt64, `query_id` String, `trace` Array(UInt64), `trace_full` Array(String), `version` String, `revision` UInt32, `build_id` String) ENGINE = MergeTree ORDER BY (event_date, event_time) SETTINGS index_granularity = 8192: while loading database `system` from path /var/lib/clickhouse/metadata/system
```
{
    String table_metadata_path = getObjectMetadataPath(to_table_name);
    if (Poco::File(table_metadata_path).exists())
    {
        auto detached_permanently_flag = Poco::File(table_metadata_path + detached_suffix);
        if (detached_permanently_flag.exists())
            throw Exception(ErrorCodes::TABLE_ALREADY_EXISTS, "Table {}.{} already exists (detached permanently)", backQuote(database_name), backQuote(to_table_name));
        else
            throw Exception(ErrorCodes::TABLE_ALREADY_EXISTS, "Table {}.{} already exists (detached)", backQuote(database_name), backQuote(to_table_name));
    }
}
void DatabaseOnDisk::renameTable(
        ContextPtr local_context,
        const String & table_name,
        IDatabase & to_database,
        const String & to_table_name,
        bool exchange,
        bool dictionary)
{
    if (exchange)
        throw Exception("Tables can be exchanged only in Atomic databases", ErrorCodes::NOT_IMPLEMENTED);
    if (dictionary)
        throw Exception("Dictionaries can be renamed only in Atomic databases", ErrorCodes::NOT_IMPLEMENTED);
    bool from_ordinary_to_atomic = false;
    bool from_atomic_to_ordinary = false;
    if (typeid(*this) != typeid(to_database))
    {
        if (typeid_cast<DatabaseOrdinary *>(this) && typeid_cast<DatabaseAtomic *>(&to_database))
            from_ordinary_to_atomic = true;