Question:I have a question about baptism, I thought that one could not be taught wrong and baptized right. I recently got re-baptized, because I was young (12) years old when I obeyed the gospel. I just could not remember if I understood what the gospel was about at that time. I remember hearing when a person turns 12 their sins are on them and if they died in their sins they would not go to heaven, this was not taught in the Church of Christ, I remember family saying this. I was so scared, I honestly think I got baptized because I did not want to go to hell. I am 39 years old, I have always struggled with this so to be save I got re-baptized. I fully understood what I was doing, and I feel relieved that I done it the correct way. If someone was a member of a denomination, even though they may know what they were getting baptized, for example believing that Jesus Christ is the son of God, that he died was buried and resurrected for the remission of our sins and that we must also die, be buried (not sprinkled,) and resurrected (our first death putting away the old man) when we are buried in the water we then come in contact with the blood of Christ washing away our sins. Are individuals coming out of denomination baptized right if they believed the gospel, although they were worshiping under false doctrine? If I were in that situation I would rather do it again rather than wait till the last day and God say depart from me I never knew you your work is of iniquity (Matthew 7:23).
I believe you are referring to my recent answer to a question where a woman was baptized when attending the Baptist religion, but she now insists that she was baptized for the right reasons even though the Baptist's teachings are incorrect regarding baptism.
This situation is different from your own. You questioned whether your baptism was done for the right motives, this woman insists that she did it for the right motives despite the fact that the denomination she was in at the time teaches an incorrect view of baptism. I suspect that she isn't being honest about the situation. She is likely rewriting history to match what she currently knows, but I must also acknowledge that I cannot read a person's mind nor can I look back at the past to see what was done. There is a possibility, remote as it might be, that she as an individual did the right thing despite being in a religion that taught the wrong thing. Since I'm handicapped, I must allow God to settle this matter.
In general, if a person is being baptized by immersion for the remission of his sins, understands that his baptism joins him in the death, burial, and resurrection of Jesus Christ, then it is a valid baptism. Who does the baptism doesn't matter -- if it did, then we would run into problems with how a church can restart when people learn the truth from the Bible. I had a case two years ago where four young men studied themselves out of Catholicism, but they were in a Muslim country with no church in the region. They settled on baptizing each other and thus a small church was born along with four new Christians.
When a person questions whether his baptism was valid, and people coming out of denominations ought to examine both what and why they did things carefully, I encourage him to be baptized again. If his first baptism was valid, the second causes no harm. If his first baptism was invalid, then he can be confident he has done the right thing.