There is no superior right to the custody of your child based upon your gender or sexual orientation. All custodial decisions are ultimately decided by the Court based upon what the Court determines as the best interests of the children. Although the wishes of children of advanced age are important, those wishes alone do not determine the outcome of custody. Children should never be used as pawns in the dispute between parents, nor should they be enlisted as allies by one parent against the other.
Often the court appoints an attorney for the child. The court-appointed attorney for the child is a zealous advocate for the child - not an investigative arm of the Court, but an attorney representing a child and bound by all of the ethical codes and standards imposed upon all attorneys in their professional relationship with their clients.
The relationship is no different because the client is a child and the attorney is court-appointed.