@wbg Thanks, your diagnosis is right, and the two PDO queries made it quick to confirm.
The cause. The FOG database layer turns prepared statement emulation off, so MySQL refuses a statement that uses the same named placeholder twice. The cache record used :now for both the check time and the cache time. The database layer logs that error and carries on, so the service never saw it. That is why your log says 0 failed. With no row stored, the cleanup found nothing that needed the files and removed all six installers plus the manifest. That is the 7 removed.
The fix. Each value now has its own placeholder. The same bug was in the code that records a closed user session, so that is fixed too. The test database now refuses a repeated placeholder the same way MySQL does, so this cannot slip through again.
Fix: https://github.com/FOGProject/fogproject/pull/2317
To test once it is on dev-branch. Update the server to dev-branch. No schema update and no agent update are needed. You do not need to clean anything up either, because the cache is already empty. On its next run the Release Sync service downloads 7-Zip again and keeps it. The General tab on the 7-Zip entry then shows the cache state.
LibreOffice. That message is expected. A package with dependencies is not cached yet, so it installs from the internet as before.
Thanks again for digging into the code. Please post what you see after the update.