Jesus is not only truly God, but he is truly human.  No human baby knows everything about its society.  Jesus learned from his parents and later on, he did go to 'school' to be prepared to make his Bar Mitzvah.  He needed to be able to read and write.  Between school and Joseph, he certainly learned the rudiments of math.  Jesus knew very well what was and what was not prohibited.  B U T....

Jesus CHOSE to disregard certain elements of common Jewish practice----because he knew what was JUST human practices [usually taught to the people by the religious authorities], and how God viewed those practices.  For God, the love and concern for these people [viewed as sinners] was vitally important.