Your flaw is the "alert on command" statement. Sorry, but i have never seen that happen. I have seen them search on command, attack on command, but never provide an alert to the presence of drugs on command.

If you are alleging that the cops forced the dog to alert, and it did not do so on its own volition, then the search was invalid, assuming this can be proven.

However, if the dog alerted, but was mistaken, then the question would turn on whether the officers had a valid reason to believe the alert. i.e. does this dog have a history of falsely alerting. if this dog has a highly accurate past when it alerts, then the search is valid, and the person is screwed.

The CYA statement: I assume that this is a hypothetical situation, does not apply to anyone in particular, and assumes a general jurisdiction (no specific state), as this is not intended for the purpose of providing legal advise.