To answer this question, you need to identify the files for which now previews are generated anymore. Are they all JPG files, or of which type they are? You might also find log entries giving your more insight about why some previews haven’t been generated.
BTW, it might always be a good idea to provide some more information about your environment, OS, Nextcloud version etc.
what I see after manually checking hundreds of them: mostly JPG files (few HEIC).
for few of them there are log entries, usually saying “too large”
(“ImagickException: width or height exceeds limit `/usr/data/nextcloud/data/user/files/xxx/IMG_1234.HEIC’ @ error/cache.c/OpenPixelCache/3912”: typically panorama shots with e.g. 16374 x 3756 pixel where limit is 2048 pixel so those are understandable error log entries).
Long story short:
while writing this post I reran “occ files:scan-app-data” and immediately (after finished within 20 minutes) all the missing previews where there.
So files were existing but not indexed in the database yet, seems the “occ preview:generate-all” didn´t work/finish properly. Table “nc_filecache” is now significantly bigger than before containing all the appdata_xxx/preview files.
Therefore I reran both (first generate-all and second scan-app-data) occ commands again two times just to make sure; now it looks good again. So the optimization wasn´t the root cause, I bet on one/both occ commands not finishing cleanly.