If carpenter bees do not sting humans then why did one sting me?

female carpenter bees can sting. The alternative is it was not a  carpenter bee.