Many “corrupt” PDFs are broken indexes
A file that a viewer refuses to open sometimes has a damaged cross-reference table or a messy header, while the page streams are still there. Rebuilding that structure is what the first pass attempts. It is not a guarantee, and it will not invent pages that were never saved.
