The error TEMPLATE_INCONSISENT comes from the underlying PKCS#11. Usually it means that some of the attributes you set is not compliant with the others. Which PKCS#11 module are you using?
Also, reading the page 79 of PKCS#11 2.20 specifications, the example in that page doesn't use MODIFIABLE attribute:
CK_ATTRIBUTE template[] = {
{CKA_CLASS, &class, sizeof(class)},
{CKA_CERTIFICATE_TYPE, &certType, sizeof(certType)};
{CKA_TOKEN, &true, sizeof(true)},
{CKA_LABEL, label, sizeof(label)-1},
{CKA_OWNER, owner, sizeof(owner)},
{CKA_VALUE, certificate, sizeof(certificate)}
};