That sounds right. @Joseph can confirm, but I’ve been told that com licença is to excuse yourself or ask for forgiveness before you do something like reaching across the table, closing the door, hanging up the phone (weird, right?) etc.
On the other hand, desculpe (formal) / desculpa (inf) are for apologizing after you’ve screwed up, since you’re asking them to remove culpability from you.