I found the problem. We are using several subscriptions i.e. having a provider for each. Even though the resource group was created with a certain provider, also the network resource was forced to have the following statement:
provider = azurerm.provider-sub-hub-we