Error while installing Mavericks in a clean hard drive
I know it's late, but if anyone coming here for macOS 10.10+ I did the following:

Reset Drive


Boot in recovery mode (Cmd ⌘ R)
Select Disk Utility
Choose Macintosh HD
Verify Macintosh HD
Erase Macintosh HD


Reset Mac time and PRAM


Restart and hold Cmd ⌘ Opt ⌥ P R (Resetting PRAM as stated above)
After second chime, hold Cmd ⌘ R to boot in recovery mode
Select language
Enter wifi information (or plug in ethernet cable)
Select Utilities from the task bar
Choose Terminal
Enter date mmddHHMMyyyy where mm = two digit month, dd = two digit day, HH = 24 hour, MM = minute, yyyy = 4 digit year (time zone was incorrect for me, but didn't seem to matter)
Exit Terminal (Cmd ⌘ Q)


Reinstall macOS


Reinstall Mac OS X (or macOS)


It worked only after doing all of these.

Source:
https://blog.macsales.com/31640-tech-tip-an-error-occurred-while-preparing-the-installation-fix