I went through Wikimedia Commons dump and checked for all invalid PDF and Djvu files (those with no thumbnails, 0x0 size, and zero pages) and tested them. Those which were really invalid I tried to replace with a fixed version, or if I could not find a fixed version, I marked them for speedy deletion.
But I have found some files which look invalid on Commons which seems to load fine (at least in Firefox for PDF, and ddjvu for Djvu files). Maybe there is some issue with how they are processed on the backend?
Here is the list:
https://commons.wikimedia.org/wiki/File:Arheograficheskaya_komissiya_Letopis_zanyatij_01_1861.pdf (processing of thumbnails started, but then it died)
https://commons.wikimedia.org/wiki/File:Policiski_recnik_2.pdf
https://commons.wikimedia.org/wiki/File:Rachmaninov_Francheska_da_Rimini_clavier_op_25_ukrainian.pdf
https://commons.wikimedia.org/wiki/File:Simple_APG_Grant_Agreement_-_Wikimedia_ZA_-_Annual_Plan_2021-2022.pdf
https://commons.wikimedia.org/wiki/File:Wikimedia_ZA_(NPC)_Financials_-_2019.pdf
https://commons.wikimedia.org/wiki/File:CADAL08001216_文選樓叢書_疇人傳:卷十二.djvu
https://commons.wikimedia.org/wiki/File:CADAL08011455_清代学术丛书·第一集·颜氏学记:卷七至卷八.djvu
https://commons.wikimedia.org/wiki/File:Niva_1891-05.djvu
https://commons.wikimedia.org/wiki/File:Кирилова_книга_часть_8.djvu
https://commons.wikimedia.org/wiki/File:Русский_биографический_словарь._Том_15_(1910)_—_с._24-25.djvu
https://commons.wikimedia.org/wiki/File:Томские_губернские_ведомости,_1900_№_38_(28_сентября).djvu
https://commons.wikimedia.org/wiki/File:Указатель_статей_морского_сборника_1848_-_1872_г._1875(2).djvu
See also (and possibly duplicate with): T297942, T298417, T299521