We cannot have a system where people can be wrongly convicted while being denied a proper defence due to incompetence. Either incompetence cannot be a defence, or convictions must not be permitted to be made where incompetence might lead to an injustice.
Or another way of looking at this: "the prosecution's case would fail if anybody involved on the prosecution's side turns out to be incompetent" should be an absolute defence in any trial and if that situation arises then it must always fail to result in a conviction.