When a template is being created and is assigned to a metric, and then this template is deleted, then an invalid reference to this template is retained in the generated metric model (whereas it should have not retained any reference to a template).
It is also impossible to change to an empty template once a template has been selected for a metric.