and when they had fulfilled the days, as they were returning, the boy Jesus stayed behind in Jerusalem. Joseph and his mother didn't know it,

 If that was the case in Egypt, it may well be that in Judaea, where the old tribal ancestries still held good, men had to go to the headquarters of their tribe. Here is an instance where further knowledge has shown the accuracy of the New Testament. 