You go to database of M2 site, run this SQL command:
SELECT * FROM `core_config_data` WHERE `path` LIKE '%dev%'
Change 'dev/js/merge_files' to '0'
Then run deploy theme command with SSH to see if it works?
Otherwise, you could [reach our team of experts] to know the easiest & most optimal approach to this issue.
Best Regard.