As suggested most likely just different data. For example trying to load the word document as XML. And as suggested you can output the exact path etc to try to find out what is going on.
As an alternative, if you can reproduce the error on your development system try adding the following method call at the start of your program then compile it and run from the command line again:
Debugger.Launch Method (System.Diagnostics) | Microsoft Docs[
^]
When it is running you will see what looks like an error message. But it isn't - it is a message that allows you to debug the application, without having to start it from Visual Studio.
This method does not work if it is only reproducible on a system without development tools. In that case better log output is the way to go.