Can't they replace online database with asymmetric cryptography in that QR code? This way a machine can validate manufacturing date even offline, i.e. more reliably.
If it’s contaminated ‘coz expired, it’s doable. Many devices have accurate real-time clocks even offline, e.g. GPS. It’s easy to include the expiry date in that cryptographically-signed data. BTW, Kerberos protocol does similar things with their timestamps.
If however it’s contaminated just because the producer decided to recall a batch of their product, then yes, a centralized server is a good choice.