This is a common error, and we may need more detailed statements from you to determine the cause. The specific reason may be related to table locks on the linked server, or it may be associated with the transmission of overly large intermediate tables during execution.
You can enable Trace Flag 7300 in order to get a more detailed error message from the provider. Refer to this article.
If there are no remote linked tables, you can try to see if the statement executes successfully on the local machine.
You can also review the execution plan of the statement to analyze the resource consumption situation.
Hope my answer may help you.