Well, that's a good question.
I think all truth only comes through a deep personal prayer life and revelation direct from God, and false doctrine comes through either an opening of some sinful disposition, or being misled by those in authority over us.
If one is willing to check all motivations in at the door, and seek God "until" an answer, I believe God always will direct one what to believe. But instead people look to their intellect, or studying large volumes, or people that are charismatic, or wrong sources of security.
Most false doctrines are demonic in origin in my view. Thankfully God will forgive most false doctrine, so that is some peace of mind, but it still costs us something and hurts somewhere. It's always respectable to just say "I don't know" if you don't and it's more honest.
We can categorize doctrines as less important to know, or not important to know. or necessary for salvation. For example if I believe Jesus was a space alien from the planet Zenos but still died for my sins, it gets really confusing whether God would count that as trust in his grace despite the accompanying weirdness. And in fact in this sense doctrine can be seen as a spiritual and not mental thing, not just a fact in the mind but something that becomes in some way a part of us through these deceiving spirits.
If one is personally diligent and sincere, I believe they will with certainty be led into right doctrines in all vital areas, that is not a maybe, we have God's promise. So you can actually guarantee that you believe the right things by following that simple principle and asking God to show you where you are deceived, and thus it is a security and comfort to know how to guarantee safety against self-deception.
No one I've ever talked to that believed false doctrine ever spent serious sacrificial amounts of time sincerely asking God to reveal their errors and show them the truth. They instead trust their own rather shallow praying and always claim to have perfect sincerity, which in itself, is a sign of deception, as none of us can achieve perfect sincerity.
I wrote a post on these ideas and how to guarantee one has the truth, but I don't think it's on this forum yet.
Peace.