It's called deception. Jesus warns of it through out the entire Bible.
Matt. 7:
22 Many will say to me in that day, Lord, Lord, have we not prophesied in thy name? and in thy name have cast out devils? and in thy name done many wonderful works?
23
And then will I profess unto them, I never knew you: depart from me,
ye that work iniquity.
You can't say these people didn't believe in Jesus, or that they didn't think they were righteous. But one thing was missing that cost them their salvation.
Matt. 24:
4 And Jesus answered and said unto them, Take heed that no man deceive you.
5
For many shall come
in my name, saying, I am Christ; and shall deceive many.
Keep in mind that there is only one group of believers on the planet that fit's this description, and that is "Christianity".
satan used God's Words to deceive Eve in the very beginning, and Jesus warns it still is. We have a simple test though, given us by God through His Word. How can we truly know if we have been deceived by the "many" who "come in His name". Remember, if we are truly deceived, we won't know it.
1 John. 2:
3 And hereby we do know that we know him,
if we keep his commandments.
This is the perfect test to see of it is God who has written His Laws on our hearts, or if it is a spirit "disguised as an Apostle of Christ, or "Minister of Righteousness" which we were warned about so many times.
5 But whoso keepeth his word, in him verily is the love of God perfected: hereby know we that we are in him.
6 He that saith he abideth in him ought himself also so to walk, even as he walked.
The perfect test. How did Jesus walk? What commandments did He Honor? We need look no further than Christ because.
Rom. 10: "
4 For Christ
is the end of the law for righteousness to every one that believeth.