So I guess God was wrong.
No, God was right in correcting Peter. The vision was meant to show Peter that gentiles were going to be given the holy spirit the same as Jews. Peter had taken the Lord's food laws, which were good and valid, and had applied them to gentiles. This was never the Lord's intent and purpose for how Jews were to treat non-Israelites.
Deu 10:18 He administers justice for the fatherless and the widow, and loves the stranger, giving him food and clothing.
Deu 10:19 Therefore love the stranger, for you were strangers in the land of Egypt.
By the the time of Christ Judaism had built upon itself numerous laws and regulations many of which were non-biblical. These things caused Jews to consider any contact with gentiles as forbidden due to the fear that it would somehow contaminate them.
The Lord sent the vision, sent the gentiles and then sent his holy spirit so he could both correct Peter and begin fulfilling prophecy about Christ:
Act_13:47 For so the Lord has commanded us: 'I HAVE SET YOU AS A LIGHT TO THE GENTILES, THAT YOU SHOULD BE FOR SALVATION TO THE ENDS OF THE EARTH.'