This message is infuriating at best. “mac os could not be installed on your computer an error occurred installing macOS.”
The crux of this is that there is one minor tweak which can save you literal hours on installing your osx.
When in the installer window click on “Utilities” then “Terminal”.
Following that type the following command in the terminal window.
So for example:
would translate as
date may 23rd 11:59am 2021.
Hit enter and continue installing OSX El capitan, Sierra or High Sierra, Mojave at your leisure