Contempt for a definitive religious command and explicit denial of a revelation established to be true are different from committing an act while acknowledging its prohibition. Some conduct may itself express unbelief, but attributing unbelief to a particular individual still calls for the relevant facts and conditions.
Neither “every sin is unbelief” nor “no action can ever express unbelief” is accurate. The kind of action, what it signifies, and the person's established stance are material, not a bystander's anger or suspicion.