Hostname SSL generates certificate issued to previously set, now deleted domain

Hi, I had created a sample sub-domain on my cyberpanel which was then linked to open CyberPanel as https://panel.website.com:8090. I wanted to remove the port so I looked at your post here - How to remove port 8090 from CyberPanel which worked fine in the very first try and my CyberPanel started opening directly without port.

But, as I’ve told earlier, this subdomain was a sample one, so I created another website on Cyberpanel on my primary domain, linked it to the CyberPanel generated a certificate for it and it started working fine.

After a day, I was checking the list of websites in CyberPanel and I deleted the old sample one as it had no use, since then, my CyberPanel stopped working without port as it was set on https and the certificate the hostname generates, is still issued to the old domain for some reason which gives the certificate invalid error. It might’ve stayed in some local files, cache etc and no matter how much I tried generating the SSL, it didn’t work.

As certificate generation has its own limit, so today, I tried it again after 11-12 days and the certificate got updated on https://panel.website.com:8090 and is issued to this domain but on https://panel.website.com, it still is issued to the old domain and says certificate not valid with the error NET::ERR_CERT_COMMON_NAME_INVALID.

How to get the hostname SSL generate the SSL correctly? or is this issue related to something else? Any help would be appreciated.