Are you sure you included the base domain? It looks like you only provided -d *.mydomain.com and not -d mydomain.com. A wildcard for *.mydomain.com isn't valid for justmydomain.com - that needs to be added explicitly.
how can I do in the correct way ?
I use this command:
sudo certbot certonly --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns -d *.maindomain.com
It generates ok certificates overriding the maindomain cert.
In my apache virtualhost , for my subdomain I add the same lines that has maindomain
Example:
SSLCertificateFile /etc/letsencrypt/live/maindomain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/maindomain.com/privkey.pem
But in browser saidme that certificate is not valid (I restarted apache)