The first determination would be to identify the parentage of Anne/Anna since that male descent surname(of her father) would be the direct link with commonality to be of the same lineage of "William F. Cody" who was "Buffalo Bill" if they are related to each other. Perhaps this will assist:
On the (first) marriage record for your great grandmother (who was married first to O'Brien in Boston, and also had children by that first spouse; then next, later she was remarried to your great grandfather Mackey and they had children by that second marriage of hers)it shows that her father was named as Patrick (notably, apparently the same given name of your uncle whom you have named in your query - not uncommon in traditional naming patterns).
It may be helpful that the date of her birth was Feb 1865-67 and that she was supposedly/likely born in Newfoundland,of which said location has also been shown for the birthplace of both of her parents (which could be, naturally, simply speculative and might well be without verification). Contacting the repositories in that locale for birth records may be useful.
Do you know when/ where she passed? It's possible that specific information may prove helpful to locate a death/burial record or obituary/ for her that would (guardedly) reveal the names of her parents or siblings - although obviously such is not always the case, if even accurate. That, too, may well help to narrow the search.
Another suggestion would be to locate further information of your great grandmother's immigration since it has been shown that she may have immigrated to the USA in 1887 or 1888(both dates shown, which yet may or may not be accurate.
There were a great many Cody (and with the usual slight variants of spellings) families in the Newfoundland Records (inclusive of predominantly the Catholic Church, and of many who arrived from Ireland) during the timeframes that would be plausible that would include your great great grandfather Patrick.