I recently encountered unexpected behaviour while installing another app as a non predefined prerequisite. Because of a problem during the installation of the prerequisite the installation could only be stopped on some machines by killing the installer with the task manager. After fixing the problem and successfully testing it individually, the app still failed as a prerequisite.
After some investigation we managed to figure out that the faulty prerequisite installer was still present in the folder \AppData\Roaming\[CompanyName]\[Product]\prerequisites\ and used during installation. There is also a registry entry pointing at this installer Caphyon\Advanced Installer\{Product Id}\[VersionNumber]\AI_ExePath. While this might be an edge case I would expect the installer to clean-up pre install to avoid these kind of issues.