I expect it should work:
```
:) select CAST(CAST('{"x" : 1}', 'Object(\'json\')'), 'Object(Nullable(\'json\'))')

SELECT CAST(CAST('{"x" : 1}', 'Object(\'json\')'), 'Object(Nullable(\'json\'))')

Query id: fb057b45-b72a-4d22-9b38-a3136cdf2465


0 rows in set. Elapsed: 0.002 sec.

Received exception from server (version 22.5.1):
Code: 53. DB::Exception: Received from localhost:9000. DB::Exception: Cast to Object can be performed only from flatten named Tuple, Map or String. Got: Object('json'): While processing CAST(CAST('{"x" : 1}', 'Object(\'json\')'), 'Object(Nullable(\'json\'))'). (TYPE_MISMATCH)
```

@CurtizJ what do you think?
{
        if (arguments.empty())
            throw Exception{"Function " + getName() + " expects at least 1 argument",
               ErrorCodes::TOO_FEW_ARGUMENTS_FOR_FUNCTION};
        if (result_type->onlyNull())
            return result_type->createColumnConstWithDefaultValue(input_rows_count);
        const DataTypePtr from_type = removeNullable(arguments[0].type);
        ColumnPtr result_column;
        auto call = [&](const auto & types, const auto & tag) -> bool
        {
            using Types = std::decay_t<decltype(types)>;
            using LeftDataType = typename Types::LeftType;
            using RightDataType = typename Types::RightType;
            using SpecialTag = std::decay_t<decltype(tag)>;
            if constexpr (IsDataTypeDecimal<RightDataType>)
            {
                if constexpr (std::is_same_v<RightDataType, DataTypeDateTime64>)
                {
                    
                    if (arguments.size() != 2 && arguments.size() != 3)
                        throw Exception{"Function " + getName() + " expects 2 or 3 arguments for DataTypeDateTime64.",
                            ErrorCodes::TOO_FEW_ARGUMENTS_FOR_FUNCTION};
                }
                else if (arguments.size() != 2)
                {
                    throw Exception{"Function " + getName() + " expects 2 arguments for Decimal.",
                        ErrorCodes::TOO_FEW_ARGUMENTS_FOR_FUNCTION};
                }
                const ColumnWithTypeAndName & scale_column = arguments[1];