When I was being set apart to go on a mission my stake president specifically said that because of my service my marriage would come about in a special way. I wasn’t really worried about marriage at that point and never thought much about what he said. After my mission I became college room mates with a former mission companion. He set me up on a date, to a young woman who I was eventually sealed to. A decade later she divorced me for very wrong reasons. So why would this revelation come to my stake president? It’s confusing and it’s one of those revelations (and there are more) that would be better off kept unsaid because they only confuse me.
There are at least two possible answers to this situation. One could be that the revelation was true and applied to your first marriage, but that the actions taken by your wife brought your marriage to an end. Even in fulfillment of revelation, we are free to act as we will both in and out of the church. You’ll find several examples of this in the Doctrine and Covenants.
The other possible answer is that the revelation did not apply to your broken marriage, but to your marriage yet in the future. In this case, keeping close to the Holy Ghost is important, just as at any other time.
Many of the blessings we receive are bound by the strength of our faith and our obedience to the Gospel of Jesus Christ. Patriarchal Blessings are quite common, as every member is encouraged to obtain theirs when they graduate from high school. The blessing given by your Stake President seems to fit in this category as well.
Your Stake President may have given you that revelation because at the time he did have stewardship over you. As such, he would have been the proper authority to receive it from God. As to why that moment was used to communicate the revelation, I would only be guessing. The most I can say is that it seems God wanted him to tell you for a reason only he (Heavenly Father) knows for certain.