What dogs and other social animals are great at is reading humans and acting accordingly. So what happens is that the owner is unknowingly instructing their pet to behave in a certain way in certain situations and the pet just acts accordingly. The pet doesn't know X, the owner knows X and signals that to the pet.
Humans tend to anthropomorphize the heck out of virtually all of their pets. The more emotional the bond, the higher the expected rate of anthropomorphization will be.
Anthropomorphize - verb
Attribute human characteristics or behaviors to an animal, god, or even an object.
Smiling during a deal might be seen as “friendly” in the West, while seen as “dumb” in the East.
If humans can’t even accurately judge the behavior of other humans why would they be able to judge that of another species?
Which contradicts your claim that "humans can’t even accurately judge the behavior of other humans “
Is it just because you believe something about dogs in general?