How could Peter error with the Holy Spirit directing his speech? If you are going with that line of illogical reasoning, then we have nothing further to discuss.
Act 2:38 Then Peter said unto them, Repent, and be baptized every one of you in the name of Jesus Christ for the remission of sins, and ye shall receive the gift of the Holy Ghost.
Repent , for the forgiveness of sin
THEN be baptized
Two separate acts Repent and be forgiven and then be baptized for the Holy Spirit
There was the baptism of John for the repentance of sin in the Gospels which are actually Old testament
Thoose that had been baptized by john were baptized again