But we know where this man comes from, and when the Christ appears, no one will know where he comes from.
John 7:27

"No one will know where he comes from" doesn't refer to the place of his birth, but to his personal history. Per John Gill and Adam Clarke, the Jews had a tradition that the Messiah would be born in Bethlehem of the line of David, but then would appear mysteriously with no backstory. This Yeshua was brought up in Nazareth to known parents, with known brothers and sisters, an extended family, etc. A few, no doubt, knew him as a boy, visiting Jerusalem at other feasts with his parents. They didn't believe that the Messiah should be so normal.