All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
According to the view of the majority of the scholars, it is a condition for the validity of the Tawaaf (circumambulation around the Ka’bah) that the person performing it makes the Ka’bah on his left during the entire rounds of Tawaaf; whoever does this, his Tawaaf is valid. In case someone does not keep the Ka’bah to his left during a portion of his Tawaaf, then this should not be counted and he is obliged to make it up.
The Fiqh Encyclopedia reads: “The person performing the Tawaaf should walk to the right of the Ka’bah making it on his left side, and this is a condition according to the view of the majority of the jurists . They determined that performing Tawaaf contrarily to this is void; they gave evidence that “the Prophet made the Ka’bah to his left while performing Tawaaf.” And because it is an act of worship related to the Ka’bah, so following the subscribed sequence in it is an obligation, like the prayer. The Hanafi School of jurisprudence said: Being on the right side of the Ka’bah while performing Tawaaf is an obligation, but performing Tawaaf contrarily to this is correct although it is prohibitively disliked, and one has to make it up again as long as he is still in Makkah. In case he returns to his home without making it up, he is obliged to offer a sacrifice.”
To sum up, the Tawaaf of the person whom you mentioned in the question is valid since he made the Ka’bah on his left during the entire Tawaaf, and him going back to get his son does not harm because he had performed Tawaaf in that distance while making the Ka’bah is on his left.
Allaah Knows best.