Hilkiah the high priest said to Shaphan the secretary, “I have found the Book of the Law in the house of YHWH.” And Hilkiah gave the book to Shaphan, and he read it.
2 Kings 22:8
The idea that God always preserves the Scriptures so that they are never lost is here disproven by Scripture. Inspired Scripture and prophecy is often lost, sometimes permanently and sometimes temporarily. The Bible contains numerous mentions of prophecies that were never recorded, let alone preserved.