You don’t say congratulations to newlyweds because they overcame adversity and conquered something, you say congratulations to newlyweds because that’s the customary way of communicating to them that you are happy for them. Like so many things, it’s not literal. It’d be like refusing to say “I’m sorry for your loss” when a friend’s parent dies, and then making a point of explaining to them that the reason you’re not going to say that to them is because you didn’t personally kill their parent therefore you have nothing to apologize for.
There was never any conundrum. "Sorry" can be correctly used in both an apology or in expressing sorrow. In saying, "I'm sorry for your loss," the context makes it clear that the speaker is not penitent, but sympathetic.