Changed host domain doesn't change puppet cert-name

Problem:

Changed host domain doesn’t change puppet cert-name so the host is not recognized by the ENC.

Expected outcome:

Changed host.X.domain.tld => host.Y.domain.tld

Foreman and Proxy versions:

1.21.3

Foreman and Proxy plugin versions:

1.21.3

I need to add here that the host is rebuild after the change. The YAML and the provisioning templates still show the old domain and not the new chosen one with the NIC.

Sounds to me like a bug but I have seen this for ages on Foreman.