I have a degree in anthropology and all throughout school I was taught to not conflate sex and gender, and to recognize that we would never really know what the individuals gender identity was because we don’t really know how their society would have recognized them or how they would have thought of themself
Also the fact that it’s not an accurate science to identify the sex of a skeleton and anthropologists get it wrong frequently, and don’t even try in other cases (prepubescent children for one)