Is this an error from running code, or when you try to open the file from Drive?
Is the file in the trash?
Did you change the code? Does the code run a lot?
Does the error happen 100% of the time, or intermittently?
Can you get the file ID of the document?