In an early revelation in the Doctrine and Covenants, the Lord tells Joseph that he can not always discern the intentions of people.
Section 10:37, Doctrine and Covenants, The Church of Jesus Christ of Latter Day Saints, accessed October 31, 2023
37 But as you cannot always judge the righteous, or as you cannot always tell the wicked from the righteous, therefore I say unto you, hold your peace until I shall see fit to make all things known unto the world concerning the matter.