1,Firstly, it's recommended to check the bdd.log and smsts.log on the client to see if there is any helpful information.
2,The random issue may be related to Antivirus software/Firewall, please remove/disable it to have a try. Similar thread for your reference:
MDT Error Installing Application Access Denied
Hope it helps. Thanks for your time.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.