I tried to factory reset a Late 2014 Mac mini by holding Command + R while booting, which took me to Internet Recovery for macOS Sierra, I used the Disk Utility to erase and format the drive, then I closed Disk Utility and clicked reinstall OS. It went on for a while but then an error appeared towards the end of the installation.
An error occurred while preparing the installation. Try running this application again.
I've tried reformating multiple times and following online guides to reset PRAM and SMC but no matter what I keep getting this error when installing the OS.
I opened the install log and saw some errors in there:
WARNING: SecPolicyOID failed to return an OID. This function was deprecated in 10.7. Please use SecPolicyCopyProperties instead. Failed to get secure URL from recovery catalog LB recovery fetch failed with error: Error domain=com.apple.installer.fixme.error code=2000
and a whole bunch of could not find package ref in any source for com.apple.pkg.xxx