Unable to upgrade from cordova to capacitor

I really need some help with an issue I have for weeks now.

I’m trying to upgrade my app from cordova to capacitor, I already have the cordova app live and the users have data in storage, but when I try to update to capacitor, I get this weird empty alert message when trying to run the app, and it won’t load… it only works if I change the androidScheme to ‘https’, but then I lose everything the user had on the storage…

If I do the upgrade with a clear storage, it also works…

Error log on browser console:
Failed to load resource:
Failed to load resource: the server responded with a status of 504 (Gateway Timeout)
plugins/cordova-plugin-file/www/FileUploadOptions.js:1 Failed to load resource: the server responded with a status of 504 (Gateway Timeout)
plugins/cordova-plugin-file/www/FileUploadResult.js:1 Failed to load resource: the server responded with a status of 504 (Gateway Timeout)
plugins/cordova-plugin-file/www/FileWriter.js:1 Failed to load resource: the server responded with a status of 504 (Gateway Timeout)
plugins/cordova-plugin-file/www/Flags.js:1 Failed to load resource: the server responded with a status of 504 (Gateway Timeout)
plugins/cordova-plugin-file/www/LocalFileSystem.js:1 Failed to load resource: the server responded with a status of 504 (Gateway Timeout)
plugins/cordova-plugin-file/www/Metadata.js:1 Failed to load resource: the server responded with a status of 504 (Gateway Timeout)