A court may not grant a petition under § 5-3B-22 of this subtitle solely because a parent:

(1) does not have legal custody of a prospective adoptee by reason of a divorce or legal separation; or

(2) has been deprived of custody of a prospective adoptee by an act of the other parent.