The fact that the SharePoint source shows Ready does not necessarily mean that the agent is successfully retrieving content from it during a test. Since the same DOCX works when uploaded directly, I would focus on the SharePoint knowledge retrieval/indexing and authentication context rather than the document itself.
A few things I would check:
Test with the actual document rather than the folder.
Add the specific DOCX as the knowledge source first. This makes it easier to determine whether the issue is with folder crawling or document retrieval.
Allow some time for indexing after adding or changing the source.
The Ready status indicates that the knowledge source is available, but retrieval can still depend on the underlying indexing process.
Check the connection/authentication used by the agent.
Since the agent uses Authenticate with Microsoft, make sure the account running the test has access to the SharePoint site, library, folder and file. Also verify that the document is not inheriting a different permission configuration from the library.
Try asking a question that can only be answered from the document.
For example, ask for an exact sentence, unique project name, or specific value that exists only in the DOCX. This is a better retrieval test than asking a general question related to the document's subject.
Check the SharePoint URL and source scope.
If possible, use the SharePoint site/document library directly rather than a broad location or a folder with complex permissions.
Remove and re-add the knowledge source after making changes.
If the file was moved, replaced, renamed, or its permissions changed after the knowledge source was created, recreating the knowledge source can help force the source to be processed again.
Compare the two knowledge sources in the same agent.
Keep the directly uploaded DOCX and the SharePoint DOCX temporarily enabled together. Ask the same highly specific question and check which source is actually returned in the citations. This can help confirm whether the problem is retrieval from SharePoint rather than the agent's orchestration.
One other point: seeing the SharePoint document listed as a source does not necessarily prove that its content was used to generate the answer. The key test is whether a question requiring information that exists only in that document produces an answer grounded in that content.
Since direct upload works consistently while the SharePoint version does not, I would also capture the agent configuration, SharePoint knowledge-source status, test question, response/citations, and permissions and raise this with Microsoft support if the behavior persists. That gives them enough information to investigate the SharePoint grounding/indexing side specifically.