I understand your concerns
Firstly such sins must be first verified in an Islamic state. Meaning just because someone is homosexual doesn’t mean they get punished.
They must either confess on 4 different occasions or 4 different people witness them in the act.
Islamic criminal law is mainly a deterrent. Yes homosexuality is like other major sins, like adultary.
In non Islamic government no punishment must ever be inflicted
We treat people as human beings. We all make mistakes and err. We need help sometimes