"Go away, Fergus!"
Well, the difference is that you put a in the first one and you didn’t in the second one (also, you left unlenited g in
Fheargais there) – neither is correct in the meaning go away, Fergus.
The correct sentence is thalla, Fhearghais, (with thalla go away) no a there, as the vocative of Fearghas is Fhearghais (it starts with a vowel – the lenited fh is silent – and so there is no a in front of it).
(Your second example – talla Fhearghais – with the lenition of g fixed, could actually make sense in Gaelic, but it would mean Fergus’s hall; the hall of Fergus.)
It really depends on the sound. If the name after lenition starts with a consonant, then you say it (and write it), that includes eg. a Fhriseil /ə r´iʃɪʎ/ (o) Fraser – since it starts with the consonant /r´/ (but that’s not because of fh which is silent, it’s because of r).
In case of Fearghas the vocative is Fhearghais /ɛrɛɣɪʃ/ – it starts with a vowel and thus the vocative particle disappears in speech (in older texts it is sometimes written, as it is before other vowels, eg. a athair instead of athair – but Duolingo sticks to the modern practice of omitting it when it’s not pronounced).
Compare how in English you write a history but an hour, and a university but an ultimatum – because the choice between a and an depends only on phonology, not orthography, and you use an before vowels.