To fix the "macOS could not be installed on your computer" error, restart the computer and try installing again. If that doesn't work, go to System Preferences > Date & Time > lock icon > enter your password > Set date and time automatically and try once more. Finally, you can try freeing up space, deleting the installer, and resetting the NVRAM before attempting to install macOS.