Cannot create VNET, the resource group is missing. StatusCode=404

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