The right to erasure does not apply when it is conflicting with member state law that requires data to not be deleted.
See https://gdpr-info.eu/art-17-gdpr/, 3.b.
So the the GDPR erasure right is not an universal right in its own, it defines a framework that you are expected to defer to when there are no statutory requirements otherwise.