The problem is that the "human bit" is not designed for zero error. Humans are, in other words, capable of making mistakes, and therefore they will do exactly that.
So, to achieve a "Zero Defects" system, you have to eliminate any input by a human, and that is remarkably difficult to do.
This takes us into the study of Human Factors, and design and implementation of Safety Management Systems, the purpose of which is to reduce and foresee human errors, and, in case that doesn't work, to capture and correct them before it's too late.
And bags will continue to go astray until all that is perfected. But I have noticed that things have got a whole lot better than in my time on the ramp, when we occasionally sent whole plane-loads to the wrong place, such as ANH instead of AUH.