What is the sin of St.Peter that made St.Paul opposed him in Galatians2:11? Paul Opposes Cephas

11 When Cephas came to Antioch, I opposed him to his face, because he stood condemned. 12 For before certain men came from James, he used to eat with the Gentiles. But when they arrived, he began to draw back and separate himself from the Gentiles because he was afraid of those who belonged to the circumcision group. 13 The other Jews joined him in his hypocrisy, so that by their hypocrisy even Barnabas was led astray.

(Galatians2:11-13)

In the above passages Peter was just eating with the gentiles and when he separated himself when certain Jews arrived, how come St.Paul opposed Peter and in other passages it even said the harsh words rebuked.

We know that Peter and the Apostles are with Jesus and know the Gospel of Jesus and St.Paul was the one not around during Jesus public ministry.
So, how come he opposed Peter whom is much knowledgeable to him by being around with Jesus personally?

The New Testament was not yet written at that time when St.Paul opposed Peter. What is the basis or the teaching of Christ that St.Paul used to opposed Peter?
It is true that they didn’t have the NT so what was the issue? Hypocrisy

'There shall be one standard for you; it shall be for the stranger as well as the native, for I am the LORD your God.'&quot; Leviticus 24:22

Peter was setting up division in the body of Christ between the Jew and the Gentiles. But no one enters by blood rights into the body of Christ according to John1:13

who were born, not of blood nor of the will of the flesh nor of the will of man, but of God

Therefore if all men enter by the will of God there should not have been an issue for Peter to have remained at the table with the gentiles.
User SLM comment added to the answer

“The apostles and the elders were gathered together to consider this matter. And after there had been much debate, Peter stood up and said to them, &quot;Brothers, you know that in the early days God made a choice among you, that by my mouth the Gentiles should hear the word of the gospel and believe. And God, who knows the heart, bore witness to them, by giving them the Holy Spirit just as he did to us, and he made no distinction between us and them, having cleansed their hearts by faith.”
‭‭Acts‬ ‭15:6-9‬ ‭ESV‬‬

Apostle Paul was in the audience

“And all the assembly fell silent, and they listened to Barnabas and Paul as they related what signs and wonders God had done through them among the Gentiles.”
‭‭Acts‬ ‭15:12‬ ‭ESV‬

It would be hypocritical of Peter to acknowledge the Gentiles (Ten Lost tribes of Israel and gentiles) as being indistinct from the Jews (Tribe of Judah and Benjamin only) if both are accepted into the body and receive the same Holy Spirit by faith.
It could be that Paul is pointing out Peter’s inconsistency or hypocrisy