I think that the first time, the traffickers probably groomed this child over the internet by respecting the child's gender identity and providing a listening ear. Some of the adults on forums, seemingly there to provide support to kids struggling with their families are there to alienate children from their parents in order to do this.
This has been a phenomenon on the internet since children got internet access, and gender identity theory is a gift to them to exploit. Not only is it a cause of familial disagreement and discord, it even has Amnesty endorsing "people are who they say they are" as a slogan, undermining every internet safety initiative ever. So the child likely ran away the first time, thinking there was a safe harbour ahead.
The second time, it could have been the same traffickers, different traffickers (again, anonymous people providing support over the internet with malign intentions), or traffickers just spotted a distressed child with nowhere to go. Pimps used to patrol train stations, looking for teenagers who had run away or been made homeless by their parents, in order to prostitute them, and it's the same thing, isn't it? The child ran away from an official state home that time, and I would stake money on traffickers/pimps having contacts in the area, who are on the look out for runaways. Children in care are very vulnerable, and they are specifically targeted.