As a bit of background trivia:
Whoever thought of using ground coffee to mask the smell of drugs was certainly using their little gray cells, but alas they were just wrong.
Not all breeds of dog make for great scent detection tools. As with people some are better suited for the task than others. With any breed that is biologically up to the job, some individuals are better than others. Just like people (sculptors, singers etc).
The sniffer dogs are more than capable of easily breaking complex scents down into their constituent parts. Much like the keen ability of some sharks to differentiate highly diluted traces of blood in sea water. Different dogs are usually used to detect different materials to keep the dogs focused on specific goals. Some alert for food, others to drugs, money, explosives etc.
While a creative way to try and pull a fast one, unfortunately, it was a idea that did not take into account the actual abilities of the dogs they were trying to fool. If one wishes to attempt to avoid detection by a well trained dog, the approach that one needs to employ involves a very strong odor(s) that is extremely irritating to the point of being painful. The problem here is that such scents (usually chemical in origin) of sufficient strength to put the dog off can usually be detected by the person holding the leash. A strong adverse reaction from the dog will almost certainly send that bag or box off for a secondary screening by a person or machine.
The operators of the airport scanners are hitting on the bags of coffee because they look suspicious - size and shape and there is usually more than just one similar item in the bag. The more complex scanners can also alert the operator to the fact that the suspicious brick shaped packages contain an organic compound such as Pot. Cocaine is not an organic compound but powders do show up on the scanner screens with an easily identifiable optical density and appearance for those trained to spot it.