Swap operation fails when WEBSITES_ENABLE_APP_CACHE=true is set only in production. If you check the documentation, it doesn't mention that this setting needs to be enabled in all slots:
https://github.com/Azure-App-Service/KuduLite/wiki/App-Cache
I think it would be valuable to add a mention of this situation to the documentation page.