"understanding as to the present truth, that they may lay hold upon it and live. And even if self-sent men put themselves where God does not put them and profess to be teachers, and souls receive the truth by hearing them talk it, this is no evidence that they are called of God. The souls who receive the truth from them receive it to be brought into trial and bondage, as they afterward find that these men were not standing in the counsel of God. Even if wicked men talk the truth, some may receive it; but it does not bring those who talked it into any more favor with God. Wicked men are wicked men still, and according to the deception they practiced upon those who were beloved of God, and according to the confusion brought into the church, so will be their punishment; their sins will not remain covered, but will be exposed in the day of God's fierce anger. EW 98.1"
"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? And then will I profess unto them, I never knew you: depart from me, ye that work iniquity."
Both passages address the issue of people performing religious acts (teaching, prophesying, etc.) without genuine connection to God, and the ultimate rejection they will face. The EGW passage expands on the consequences and motivations of such individuals.