The maxim goes that “I write to find out what I think”. (Variously attributed to Flannery O'Connor or Joan Didion). It counsels that articulation highlights gaps in arguments, requires concrete positions, and dispels denial of inconvenient conclusions. I do not dispute it.
However, I suspect that the effects flow in both directions. When writing, certain thoughts bubble up from the surface of the mind at the opportune time, by chance. The demands of concision, the limits of time, and the lionisation of decisiveness then exclude the alternatives. Warranted or not, writing amplifies those lucky musings. Unjustified confidence condenses from ambiguity. The words become a commitment, provoking cognitive dissonance when the mind strays elsewhere. Doubly so if published.
Write with care.