Okay, to reproduce: the HTML must be entered while the BB-Code editor is available and toggled active (which will damage the custom HTML). When creating a template directly (Create New Template button) there is no BB-Code editor, which is why I could not reproduce before.