Tagging a Legend in Revit

FamilyType.ByName is not working as expected. If a family type name as string is used works fine.
But both of them are strings.

Any idea? @christopher.rossetto