Declaring a provider block inside a reusable module is legal but has a consequence Terraform documents as a limitation: a module containing its own provider configuration cannot be removed from configuration in a single step, because Terraform still needs the provider to plan the destruction of the resources it manages, and the configuration that defined it is gone.
The error is Provider configuration not present ... to work around this, use terraform state rm, and the recovery is to remove the resources first, apply, and then remove the module block.
The supported pattern is to declare providers only in the root module and pass them explicitly with the providers meta-argument when a module needs a non-default one, for example a second AWS region. Modules should declare only required_providers with version constraints and a local name, never a configured provider block. This also matters for count and for_each on modules, supported since Terraform 0.13, which are rejected outright on a module that contains a provider configuration.