I is possible to add a trailing space to a template name when it is saved. This makes it impossible to delete, as it seems that the space is trimmed in the deletion code.
Actually, looks like this was caused by having a colon in certain template names. Unable to reproduce after fixing that bug in bda7a11fed14a1bf3dd67e07ddda00f3e86e65cb.
I is possible to add a trailing space to a template name when it is saved. This makes it impossible to delete, as it seems that the space is trimmed in the deletion code.