Error Invalid SSL certificate after create a new domain / subdomain

I use SSL origin server from cloudflare.
So far I have created > 60 subdomains for SaaS automatically via API, with the format xxx.mydomain.tld without any problems.

Yesterday I typed a typo by typing a dot character (.) adding a subdomain so that there are sub-sub-domains, such as xx.x.mydomain.tld.
I have deleted the problematic xx.x.mydomain.tld, but currently my hestiacp has one problem, namely:
every time I create a new domain/subdomain using the SSL origin server from cloudflare, the result is “Invalid SSL certificate (error code 526)”. I tried reloading nginx without success. But when I try to restart nginx the problem is solved.

I have tried various methods such as adding ssl manually using letsencrypt both through the hestiap panel and through the CLI, but the results are still unsuccessful. Every time I create SSL Letsencrypt the result is an error: Let’s Encrypt finalize bad status 403 (xxx.mydomain.tld).

How can I avoid having to restart nginx manually when creating a new domain/subdomain?

Additional info:

  • previously I also experimented with creating a reverse proxy by adding .tpl and .stpl templates, but I have deleted both files. Is there any connection?

Thanks for all the help

Can’t you just delete the site / recreate it?

Recreate?
Maybe you misunderstood what I meant, because my English is not very good.

The problem appears EVERY TIME I create a new domain / subdomain. But the problem will be solved when I restart nginx.

The problem appeared “maybe” since I got an accident by typing sub-subdomain, as I told you in the post. I include the word “maybe” because I don’t know if this typing mistake was the cause.
What is clear is that currently every time I create a new domain / subdomain, I have to restart nginx manually so that the Error Invalid SSL certificate does not appear.
I want to return to normal as before that there is no need to restart nginx to create a new domain / subdomain.

Can you give me a hint where the problem lies?