Deploy fails with error ' Error Status 422: An error occurred while validating the request parameters.' when installing a deploy v5 binary on top of an old app binary

I have recently updated my app to use the new deploy API. If I download a fresh app binary (app did not exist on the device before), deploy and everything else works fine.

However, if I download the new binary on top of an existing pre-v5 app, deploy fails, and this error gets logged to the console:

ERROR: Unhandled Promise rejection: Error Status 422: An error occurred while validating the request parameters. ; Zone: ; Task: Promise.then ; Value: Error: Error Status 422: An error occurred while validating the request parameters. http://localhost:8080/plugins/cordova-plugin-ionic/dist/common.js:170:28
generatorResume@[native code]
fulfilled@http://localhost:8080/plugins/cordova-plugin-ionic/dist/common.js:8:62
run@http://localhost:8080/build/polyfills.js:3:10149
http://localhost:8080/build/polyfills.js:3:20245
runTask@http://localhost:8080/build/polyfills.js:3:10844
o@http://localhost:8080/build/polyfills.js:3:7901
promiseReactionJob@[native code]