No attempt at semantic sleight of hand can justify what is sinful behaviour. Our Lord Himself criticized the Pharisees for such behaviour noting that while they adhered rigidly to the letter of the Law they completely ignored its spirit. The Magisterium/ Church cannot possibly be expected to legislate for every possible life event, in this case a Catholic singing at a same-sex wedding. Instead it issues (usually via the Catechism) broad principles that can be applied intelligently to a wide range of scenarios. Just because singing at a gay wedding hasn’t been officially condemned by the Magisterium doesn’t mean that it is right.
Trying to perform semantic gymnastics to justify what is wrong behaviour is absurd. By the logic of some, a Catholic could perform (by singing or some other public act) at the opening of an abortion clinic, or euthanasia clinic, free from sin. If our faith is to mean anything and be truly “alive” then it means walking the walk and not just talking the talk. If that means refusing paying work as a matter of conscience then so be it. Semantic gymnastics, evasion, doublespeak, hair splitting etc can be used to justify wrong actions; such as “it wasn’t theft, I was merely redistributing wealth”.
Such moral relativism is largely responsible for much of the confusion and immorality of modern times and has been condemned by a number of Popes. A doctor performing an abortion is “replaceable”. Everyone is. Just because this is so means nothing. If he (or she) did the act (performed the abortion) then he/she did the act. End of story. And no amount of linguistic gymnastics can alter that fact.
Some people may be fooled but be sure God is not.