There's two things to note. First of all, this comes under the heading of lessons not learned. That office has had experiences like this before. They had the jailhouse informant case not ten years ago. That puts you on notice.
Police officers can lie.
Witnesses can make up cases. And you have to have procedures in place to deal with it. One type of procedure is to monitor the deputies, assess them in the field. We had one in fact that did occur. We had a deputy DA in the trial division two years ago, encountered the same officer Perez.