It works because you have now changed the length of the pathname to the file to something under 259 characters.
For example, if I have a Word document on an external drive, the pathname might be something like this.
/Volumes/MyDrive/MyWorkDocs/2019/05/Work1/Sub2/Sub3/myworkdocument02.docx
That's 73 characters (yes, example is less than 259: Too lazy to make a >= 259 path).
Move to your Documents folder, now you have something like
/Users/myuseridhere/Documents/myworkdocument02.docx
That's now down to 51 characters.
So, if crazy deep with long folder and document names, probably butting up on Office's size limits, and when moved to local drive, truncated a bunch of characters from the pathname. Ie. going from > 259 characters (which Office cannot do) to about 50-70 (which Office can do).