I ran into an interesting problem this past week in trying to publish some customizations via the RibbonWorkBench to an on-premise Dynamics tenant.
Here is the message we were receiving.
This led me down a road of checking permissions and seeing what forms I had in the solution I was working, connections being closed, security around using IFD deployments and on and on.
After a day or so, we realized the problem was that the Async Service Account could not write to the CustomizationImport folder on this server. When we granted the appropriate permissions, the problem was solved.
(One more subtle reason to consider the cloud).