So I recently ran into this problem and want to describe the issue and the solution here:
I have several virtualhosts on a httpd server and started to install letsencrypt SSL certificates on it via the certbot-auto tool.
This was working fine initially until some domains would throw errors in the browser that the certificate belongs to another domain and is not secure. The SSL setup for the domain was identical with those of other, working SSL setups. All of them are on the same IP address, the config was created by the certbot-auto tool. The domain shown in the browser as being the wrong domain that the ssl certificate points to was one of the other domains on the system.