SCCM Task Sequence Fails on Installing Applications error code: 0x80004005

When imaging systems (especially those with SSD and NVMe for hard drives), the task sequences seems to pause for a long time on installing an application and produces an error 0x80004005. All subsequent applications fail to install after that failure.

This error seems to be related to the ConfigMgr client installing right before this task and not fully initializing. The solution is to insert a restart Computer task between installing the ConfigMgr client and any other applications.