Any law that has discretion built into it is going to, unfortunately, result in situations that you simply cannot predict. We can't legislate to remove any and all risk unless we detain all the time. The thing is that the charter says there must be just cause to detain someone; they can't automatically be detained. However, in some cases there can be a presumption of detention, and I talked about the reverse-onus situations.
Ultimately, if the judge does get it wrong, there is an appeal process that's available under section 520 of the Criminal Code.