During installation, the installer reports that 'An error occurred during installation', and mentions running diagnostics This occurs when the copy of the macOS Catalina Installer app used has gotten corrupted somehow. Here are step-by-step instructions on how to download MacOS Catalina. Read the full error message Possible Fixes For macOS Installation Error
Here’s how you can fix the ‘Cannot check for malicious software’. When macOS tells you to contact the developer to run the app though, it’s a road block. The solution is to update the firmware, which seems to be what is affected with this bug. I did notice the last thing the installer logs complain about before failing is not being able to find '/Library/Preferences/com.apple/ist'.For those that have already tried a fresh install or a restore from another Mac computer and encountered the error, restarting will not help and neither will installation from a USB installer or a Time Machine backup.
I have started over several times, but this error is robust. This error occurs in both High Sierra and Mojave installs.