<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->

- [ x ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 3.0.7
* Operating System version: win10 + nacos client 2.0.4 + spring boot 2.6.1
* Java version: jdk 11

### Steps to reproduce this issue

1. my provider config
 ```
dubbo: 
  application:
    name: demo-provider
    qos-enable: false
    logger: slf4j
    default: true
    qos-accept-foreign-ip: true
    register-mode: instance
    metadata-service-port: 20885
  registry: 
    address: nacos://192.168.1.7:8848?registry-type=service
    parameters:
      namespace: 30e5435b-aa31-4db2-af93-cbac43342a84
    use-as-metadata-center: false
    use-as-config-center: false
    username: nacos
    password: nacos
  protocol:
    name: dubbo
    port: 20880
 ```
2. start it ,if happend nacos connect exception, the nacos dashboard `Service Details`   metadata info:
```
## bug???
dubbo.metadata-service.url-params={"connections":"1","version":"1.0.0","dubbo":"2.0.2","release":"3.0.7","side":"provider","port":"20885","protocol":"dubbo"}

dubbo.endpoints=[{"port":20885,"protocol":"dubbo"}]                  //my port 20880 missing ???

dubbo.metadata.revision=5f8170f8dfa06b28e94fab8cbc493738
```


Pls. provide [GitHub address] to reproduce this issue.

### Expected Behavior
always normal info:
```
## normal
dubbo.metadata-service.url-params={"connections":"1","version":"1.0.0","dubbo":"2.0.2","release":"3.0.7","side":"provider","port":"20885","protocol":"dubbo"}

dubbo.endpoints=[{"port":20880,"protocol":"dubbo"}]

dubbo.metadata.revision=d008d800101e330431113c35ab7845a1
```

### Actual Behavior

<!-- What actually happens? -->
```
## bug???
dubbo.metadata-service.url-params={"connections":"1","version":"1.0.0","dubbo":"2.0.2","release":"3.0.7","side":"provider","port":"20885","protocol":"dubbo"}

dubbo.endpoints=[{"port":20885,"protocol":"dubbo"}]    //my port 20880 missing ??? why metaservice port

dubbo.metadata.revision=5f8170f8dfa06b28e94fab8cbc493738
```

If there is an exception, please attach the exception trace:

[3.0.7.normal.log](https://github.com/apache/dubbo/files/8418937/3.0.7.normal.txt)

[3.0.7.bug.log](https://github.com/apache/dubbo/files/8419145/3.0.7.bug.txt)

I compare the log use beyond compare, but still don't know what happened...

```
// when happen this, will bug.  please see the 3.0.7.bug.log detail
2022-04-05 22:02:30.966 ERROR [demo-provider,,] 20576 --- [           main] c.a.n.c.remote.client.grpc.GrpcClient    : Server check fail, please check server 192.168.1.7 ,port 9848 is available , error ={}

java.util.concurrent.TimeoutException: Waited 3000 milliseconds (plus 14 milliseconds, 779100 nanoseconds delay) for com.alibaba.nacos.shaded.io.grpc.stub.ClientCalls$GrpcFuture@430aae8e[status=PENDING, info=[GrpcFuture{clientCall={delegate={delegate=ClientCallImpl{method=MethodDescriptor{fullMethodName=Request/request, type=UNARY, idempotent=false, safe=false, sampledToLocalTracing=true, requestMarshaller=com.alibaba.nacos.shaded.io.grpc.protobuf.lite.ProtoLiteUtils$MessageMarshaller@26d8908e, responseMarshaller=com.alibaba.nacos.shaded.io.grpc.protobuf.lite.ProtoLiteUtils$MessageMarshaller@30e2016a, schemaDescriptor=com.alibaba.nacos.api.grpc.auto.RequestGrpc$RequestMethodDescriptorSupplier@75f32817}}}}}]]
	at com.alibaba.nacos.shaded.com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:508) ~[nacos-client-2.0.4.jar:na]
	at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.serverCheck(GrpcClient.java:148) ~[nacos-client-2.0.4.jar:na]
	at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.connectToServer(GrpcClient.java:264) ~[nacos-client-2.0.4.jar:na]
	at com.alibaba.nacos.common.remote.client.RpcClient.start(RpcClient.java:390) ~[nacos-client-2.0.4.jar:na]
...
```

List<ConfigInitializer> configInitializers = this.getExtensionLoader(ConfigInitializer.class)
                .getActivateExtension(URL.valueOf("configInitializer://", getScopeModel()), (String[]) null);
        configInitializers.forEach(e -> e.initServiceConfig(this));
        
        if (!isOnlyInJvm()) {
            checkRegistry();
        }
        if (StringUtils.isEmpty(interfaceName)) {
            throw new IllegalStateException("<dubbo:service interface=\"\" /> interface not allow null!");
        }
        if (ref instanceof GenericService) {
            interfaceClass = GenericService.class;
            if (StringUtils.isEmpty(generic)) {
                generic = Boolean.TRUE.toString();
            }
        } else {
            try {
                if (getInterfaceClassLoader() != null) {
                    interfaceClass = Class.forName(interfaceName, true, getInterfaceClassLoader());
                } else {
                    interfaceClass = Class.forName(interfaceName, true, Thread.currentThread().getContextClassLoader());
                }
            } catch (ClassNotFoundException e) {
                throw new IllegalStateException(e.getMessage(), e);
            }
            checkRef();
            generic = Boolean.FALSE.toString();
        }
        if (local != null) {
            if ("true".equals(local)) {