It's the same when people keep asking why did the police think Barry George shot Jill Dando? The police get the blame, but they didn't make the decision to prosecute. The current DPP was involved in George's prosecution and conviction, but few people blame her.
You and they keep blaming the police (just one policeman in your case) when it's the lawyers and judiciary who should be sharing the criticism (but that's clearly not so convenient for your agenda).
I happen to agree with you on the bit that I underlined... i.e., "it's the lawyers and judiciary who should be sharing the criticism".
In theory, a magistrate / investigating judge should have played an active role in directing the police work in the Joana case. However, possibly due to overload, did this actually happen in practice? In the Joana case, it seems to have been more of a rubber-stamping exercise, following a "confession" in dubious circumstances. Then, the obvious question back down to the police was... right, she's confessed, now find the body.
How much time did the lawyers actually spend on analysing this case? What means did they have for expert opinions to counter the assertions made by the PJ?
How easy would it have been for jury members (a relatively rare occurrence) to divorce themselves from all the tabloid "leaks" prior to the case? And who leaked them? How could they have objectively have assessed evidence in the absence of an effective defence? The recorded "reconstruction" presented on the last day of the 3-day trial, must have been quite shocking, but in line with the tabloid "leaks".
It didn't seem to occur to anyone to question the validity of the so-called forensic evidence, nor the conditions under which Leonor and others were interrogated, leading to the initial "confession", let alone how João eventually signed on the dotted line that the reconstruction was "voluntary".