You ask an interesting question. Previously in Genesis, Ishmael is called Abraham’s son (for example, 17:23-25; 21:11). Ishmael was Abraham’s son through Hagar. Isaac later became Abraham’s son through Sarah (Genesis 21:3). Before he used Old Testament history to make a point to the Galatian Christians, the apostle Paul noted that Abraham had two sons (Galatians 4:22).
In Genesis 21, we learn that Hagar and Sarah could not get along, so Abraham sent Hagar and Ishmael away. That means that Hagar and Ishmael were not at all in the picture when God instructed Abraham, in Genesis 22, to sacrifice his son. That explains God’s command to Abraham: “Take your son, your only son, whom you love—Isaac—and go to the region of Moriah” (Genesis 22:2). The only son around Abraham at this time was Isaac. He was the one involved in the testing of Abraham’s faith.