One thing that may explain why toBinary() doesn’t help: it can only encode the string it receives. If the Nextcloud module has already converted the DOCX bytes into text and lost some byte values in that conversion, turning that string back into a Buffer won’t reconstruct the original DOCX.
Could you show the output bundle from Nextcloud → Download a File?
Mainly:
• the type Make shows for Data
• the beginning of the Data value
• the file name / size if shown
Also, does the exact same DOCX open normally when you download it directly from Nextcloud?
That should tell us whether the file is already being altered by the Nextcloud module or whether the problem happens later.