It's only a wizard cantrip if you learned it as a wizard
Cantrip formulas says (emphasis added):
[...] you can replace one wizard cantrip you know with another cantrip from the wizard spell list.
Knowing a spell that happens to be on the wizard spell list doesn't necessarily make it a wizard spell for you. For example, if you are a multi-class wizard/sorcerer, you could learn Fire Bolt as one of your sorcerer cantrips. If you do so, then you always use your charisma modifier when attacking with Fire Bolt, because for you it is a sorcerer spell, not a wizard spell.
In some cases, a feature will let you learn a spell and have it count as being associated with a certain class even if it isn't on the standard spell list for that class. If so, it will explicitly tell you so. For example, the a cleric's Domain Spells feature says:
If you have a domain spell that doesn’t appear on the cleric spell list, the spell is nonetheless a cleric spell for you.
The psionic spells of the gith subraces don't say anything about counting as spells of a specific class, so you can't treat them as wizard spells.
In terms of lore, your wizard cantrips are spells that you have learned through your focused study as a wizard, while your gith racial spells represent innate psionic abilities, so it makes sense that they are not interchangeable in this way.
There is no general rule for which non-class features grant class spells and which do not, nor are there special categories of spells like "racial spells" with distinct rules; there are just specific racial features that allow you to cast spells. If the feature granting a spell says the spell counts as a spell of a specific class, then it does; otherwise, it doesn't count as a spell of any class. (And if it's ambiguous, I'd recommend asking about it on this site.)