AddComponent asking for invalid type error for similar code

I have two different lines of code all written the same way

1st:

player.deck[j].AddComponent( Type.GetType(player.deck[j].GetComponent<TechCardDisplay>().ability.name.ToString()) );

2nd:

player.deck[j].AddComponent( Type.GetType(player.deck[j].GetComponent<MartialBlitzDisplay>().ability.name.ToString()) );

They are both written the exact same way and referring to the object that is also written the same way but for some reason the second one is getting the warning: "AddComponent asking for invalid type".

I’m so lost right now

  1. First off, get into a habit of storing component references in local variables when executing something in loops. This shaves off some CPU work when this variable is used more than once.
GameObject deck = player.deck[j];

deck.AddComponent(
    Type.GetType(deck.GetComponent<MartialBlitzDisplay>().ability.name.ToString())
);
  1. Avoid long one-liners as those make errors less apparent and longer to debug.
GameObject deck = player.deck[j];
string abilityName = deck.GetComponent<MartialBlitzDisplay>().ability.name;
System.Type abilityType = Type.GetType( abilityName );

deck.AddComponent( abilityType );
  1. Add type check and an alert when there is an issue while providing relevant information that will help fix it.
GameObject deck = player.deck[j];
string abilityName = deck.GetComponent<MartialBlitzDisplay>().ability.name;
System.Type abilityType = Type.GetType( abilityName );

if( abilityType.IsSubclassOf(typeof(Component)) )
{
    deck.AddComponent( abilityType );
}
else Debug.LogError( $"invalid ability name '{abilityName}' found - not a valid Component name" , deck );// clicking log message in console will select this deck object

@andrew-lukasik so i found that its the name space thats messing it up the string value doesnt being in the name space name, is there a way to bring that in too?