This is inevitable when you allow them to get habituated. Which is why someone has to hunt and kill coyotes coming anywhere near a human settlement every chance they get, to keep them skittish and cause them to give humans a wide berth.
You understand the mechanism very well.