No, it is not normal for Terraform code to delete existing diagnostics settings when upgrading a classic App Insights resource. Using an older version of the Terraform azurerm provider, such as version 3.12, may result in the deletion of the classic component before creating the replacement workspace-based Application Insights resource. To avoid this issue, make sure to use the latest version of the Terraform azurerm provider, version 3.89 or higher, which performs the proper migration steps by issuing the appropriate ARM call to upgrade the App Insights classic resource to a workspace-based resource while preserving all the old data and connection string/instrumentation key values.
References: