
There can be many reasons for SharePoint CAML queries not working, but one of the most frustrating ones is “The underlying connection was closed: The connection was closed unexpectedly.” The connection from the client (CSOM/REST API) is just dropped. Debugging the issue can seem, at first, almost impossible as there is nearly no additional data to work with, but sometimes the solution can be fairly straightforward.