I seem to get this bug fairly often, as well. And I have noticed that what Evandir said is true. If you move into range with one click, and then attack with another, it doesn't happen. But, why offer the ability to move and attack in a single click if I'm going to just lose my attack and (more often than not) take damage?
I thought this was a new take on attack of opportunity (as Larian is trying to stay as close to 5e rules as possible, but still keeping it fun for non-5e fans), but I've never seen it say "Opportunity Attack" in the text. It just names the attack that hits me; i.e. unarmed strike.
REALLY hoping for a fix to this soon.