It is not a bug. It is a normal consequence that NPCs become immediately and permanently hostile upon a failed "Detect Thoughts".