The Post Office also knew for a fact their defense was false but continued to lie in court [2].
In England (but not Scotland), the Post Office itself acted as prosecutor separate to the normal justice system. Investigators were incentivized to find people guilty.
Only the Post Office (covering it up) knew there were so many and they didn't tell the court and in fact they told all the accused that they were the only one (or just a handful) so none of them knew either... its only after the campaigning and research of Alan Bates (one of wrongly accused subpostmasters, and after this week knighted for what he did in uncovering it so is now Sir Alan Bates) that it all came out, especially after a documentary was made about it suddenly the general public knew as well.
Private Eye magazine (a sort of political commentary/satirical news magazine in the UK) had been reporting it for years that there was clearly a problem as it was crippingly obvious that we didn't suddenly have a country full of hundreds and hundreds of fraudulent post office workers, but the average person doesn't read it and the MPs were happy to ignore it and believe Fujitsu over their own postmasters some of whom had been doing the job for decades prior to the mess.
The enquiry evidence that's been broadcasted recently from the key players is both fascinating and infuriating on what a mess and a coverup it was.
I don't think the Post Office debacle features, but at the end of the Secret Barrister(1), a hypothetical example is given where the many critical systemic failings described in the book align to get an innocent person found guilty and imprisoned. It's pretty close to what actually happened to the subpostmasters (but for assault rather then fraud).
¹ https://en.wikipedia.org/wiki/The_Secret_Barrister. It's very good and all you can say after reading it is "Jesus, I just hope I stay lucky enough to never get involved in the courts". I don't think anything has improved since 2018.