These are good questions. I think they point to some deeper assumptions about the function of the Church as an institution which bear further investigation.
Before we get to that, though, let's clear up one critical misunderstanding. Despite what the misleading headlines on this issue have recently suggested, the Church today emphatically and explicitly does not support conversion therapy in any sense comparable to what was considered acceptable half a century ago. The objections to the bill raised by Family Services, which comprise about 26 pages, have been made publicly available online, and the objections raised are unrelated to the practice of conversion therapy, which is not endorsed or offered by Family Services. Since I started this answer, the Church has responded this past week with a clear reaffirmation of its opposition to conversion therapy and other abusive practices. (Family Services' comments are also directly available at that link.) "LDS church asks for clarification on bill set to ban conversion therapy" isn't quite as sexy and attention-grabbing of a headline as "Mormon church opposes ban on conversion therapy," but the former is a much better description of what's actually happening than the latter--the contention is about religious protections and the freedom to counsel people who want to live a life consistent with their religious values (e.g. "I'm religious and I want to stop acting out on my feelings of sexual attraction; please help me do that"). The concern seems to be that the current bill doesn't offer that. A previous bill banning conversion therapy, with stronger religious protections, faced no objections from the Church, but it died in committee, which is how we got here.
Now, granted, the Church does take positions that are often controversial. It also takes positions that cause particular groups of people pain--sometimes considerable pain. How do we reconcile that? Do we need to reconcile it? What does that look like?
Personally, I've never liked the common shibboleth that "the church is perfect but the people aren't." How can an organization being run by imperfect people from top to bottom really be perfect? What does a perfect church even look like? I'm not that old and the Church has changed considerably in my lifetime--my children and grandchildren will hear stories of three hours of church, home teaching, and missions without smart devices without ever experiencing them, and I have no idea what more will change by the time they're old enough to hear stories from grumpy old 9S about sitting through three hours of church on a hard-backed chair and only getting to call home twice a year. I think this phrase has set far too many people up to fail by leading them to equate the church as an institution or even as a culture with the gospel. The gospel is not the church, and it's not the culture. It's not funeral potatoes or weird Jell-o or the weird stuff your high councilor said one time over the pulpit that definitely doesn't square with the scriptures. The church, on both an individual and institutional level, can (and has, and still occasionally does) fail to live up to its divine mission to represent Jesus Christ--just like we struggle as individuals to do the same thing. That's not a bug, it's a feature. I can't tell you how many members I've talked to who seem to think that we suddenly get a blanket guarantee of infallibility when we move beyond the level of individuals in the church. That's not how it works.
I could go on for much too long, but I'll settle for loudly seconding what Josefina already said: nowhere are we guaranteed a perfect church. I don't know how it entered our cultural consciousness or why it's stayed for so long, but it's nowhere in the scriptures. Talking specifically about church history and the release of Saints, Elder Devn Cornish said much the same thing in the September 2018 Ensign.
"The impressions one gets from reading the history of the Church depend largely on what one expects to find in that history. We read the Lord’s own statement that this Church is “the only true and living church upon the face of the whole earth” (D&C 1:30). So it may seem reasonable to expect that the history of the true Church portray unerring leaders successfully implementing a sequence of revealed directions progressing to a perfect organization that is widely welcomed and embraced. But that is neither what the scriptures describe nor what our history represents, because the perfecting of the Church as an organization was not the Lord’s primary purpose."
"Nowhere in our scriptures, our doctrine, or the teachings of latter-day apostles and prophets is it taught that the purpose of the Lord is to perfect or to save the Church. Rather, the purpose of the Church is “for the perfecting of the saints … till we all come in the unity of the faith … unto a perfect man, unto the measure of the stature of the fulness of Christ” (Ephesians 4:12–13). The Lord’s primary purpose is to perfect His Saints. The Church serves to support that objective."
If that's how the Church worked then, it surely works the same way today. The Church sometimes does wrong. Sometimes serious wrong. You might be personally hurt by a ward member or a mission companion, or dismissed by a bishop who should be listening to you, or marginalized by a policy decision that directly impacts you negatively. The Church made up of imperfect mortals, from the youngest nursery child all the way up to President Nelson. It's only natural that the Church learns and grows along with its people.
One last thought to help expand this a bit, on the topic of revelation. Often we speak of revelation as something totally apart from--something wholly other than--human reason. In the sense that only revelation can make the things of God known to us, this is accurate. But in the broader sense we seem to use it in the church--in the sense that this somehow transcends and obliterates our cultural expectations and assumptions, and getting revelation means we download infallible, perfect pages from God's celestial, timeless Wikipedia--this is horribly off-base. Revelation comes when we ask questions. Our culture inescapably shapes our expectations and the questions we ask. All revelation is inextricably embedded within our cultural and moral framework--because how can God communicate with us any other way? All of us are products of the time in which we live and the experiences we have. Personally, I don't feel a need to reconcile the fact that Paul was okay with the practice of slavery or that Brigham Young believed in the curse of Cain or that BYU once practiced electroshock therapy--all notions that have rightly fallen out of favor today. But--and this is the important part--all of these practices and beliefs were in alignment with the common beliefs and practices of the time, and that is as it should be, because all of us are shaped by the time in which we live. Certainly God could throw the curtains back and simply blast us with new and advanced moral knowledge. But that seems rather like God attempting to reveal to Abraham that e = mc2, or perhaps explaining to John the Baptist how to use a computer.
For better or worse, the process of revelation is deeply introspective; it's a dialogue not just with God but with ourselves, forcing us to examine what we believe and why, and only when we're ready to challenge our own assumptions and really listen to what the answer might be--even if it means abandoning something we cherish--does God speak. When we fail to do that because of pride or complacency or apathy, we fall into error--emphasis on we; the onus is on us, not God, to be willing to receive the great and important things pertaining to the kingdom of God as they are revealed.
God can, when absolutely necessary, simply deliver to us knowledge that is totally new and alien, but such occurrences (think Nephi building a boat or Moses building a portable tabernacle) are extremely rare, and unlikely to come when we're complacent in what we know and not willing to look for further light and knowledge. Revelation is an invitation from God to actively involve ourselves in our own spiritual growth, not just an event that happens to us when we push the right set of spiritual buttons at the heavenly reward dispenser. Church culture has done us a deep disservice in cultivating a notion that revelation is little more than downloading the mind of God and infallibly transmitting it through one speaking as a prophet (whatever that means). God is infallible. Revelation, because it is always delivered to (and through) imperfect humans with mistaken assumptions and imperfect modes of expression and understanding, cannot be infallible, and thus it is that even the Church finds itself sometimes making mistakes. For all this, there is the Atonement of Jesus Christ. The Atonement covers not only the mistakes you and I make, but also all those who suffer because of them (and thank heavens for that). Nothing I can do will change the fact that many people have suffered because of what was formerly considered a potentially legitimate form of therapy, but Christ has borne that burden and can succor those who suffered as surely as He can for anyone else.
I hope you find something worthwhile in this answer, and that it helps you reconcile the discomfort you've felt. Feel free to email me if you'd like to talk more.