Irish uses different structures and rules with the copula depending on whether you have an identificatory or classificatory sentence and what you want to express, among other things. This Duolingo question presents an identificatory sentence with a first-person pronoun (mé) as subject : here is a link to the German version of GnaG which explains the structure. (This is also slightly different than if we had "Ní mise do chara.", where "mise" is the predicate instead of "do chara" in this example. This second one also puts emphasis on the pronoun "I am not your friend."). You also have some explanations with less details in the very old English translation here (you’ll need to scroll a bit further down).
If "Ní mé do chara" has that structure because it is identifying as opposed to classifying, why do we also see the sentence "Is é namhaid an phobail é"? Isn't that sentence similarly identificatory and thus should be structured similarly to "Ní mé do chara" i.e. "Is é namhaid an phobail"? Thanks in advance.