That command wouldn't have worked because there was no certificate named www.domainB.com.
A command that would have run successfully in this case is certbot delete --cert-name www.domainA.com but this would have had the disadvantage of breaking your Apache configuration (since that certificate was in use).
That is, re-issue the www.domainA.com certificate while forcing it to contain only the single name. The -0001 happened because Certbot assumed (incorrectly in this case) that you didn't want to reduce the coverage of the existing certificate, so it made a completely separate one to protect the existing one.
Thanks. BTW I assume there's nothing wrong with having the -0001 version, is there? Or might it store up problems for the future? In which case should I go back to the original one and remove the domain from it (and use it for the site's Apache config before deleting the -0001 version)?
No, there's nothing wrong with it in principle. You can always run certbot certificates to check which certificates you have and what their coverage is.