Patch installation task inside Managed Software Delivery policy will fail when executed on the client.
When assigning the task directly on client machine it will execute properly (no failure)
This is working as expected and not a supported use case.
For Windows Software Update Installation task in Managed Software delivery policy, the WSUIP task needs to invoke API through Task Management on the Server side to create shadow SWU policy that realizes the actual update installation.
SMF that Managed software delivery policies are built on top, do not have such ability.
Use Patch Management policy or Patch install task as standalone