Let’s say you have a domain: https://www.yoursite.com. Though this is a www site you would expect it to work for non-www as well. Meaning https://yoursite.com should still take you to https://www.yoursite.com.
For your default installation perhaps you had only one certificate for the non www version and you don’t have an SSL certificate for www version. Browser is going to throw an SSL certificate error for that.
To overcome this you could run following command which covers www and non-www version.
sudo certbot --apache -d example.com -d www.example.com
This covers both the www and non www domains and everything should run just fine.
Next, you may want to set some htaccess rules. This article talks about enforcing www.