Ah that makes sense - my last comment above about the last portion your script was because I was confused with the parts I saw in your Python script referring to Section name, etc., since it didn’t seem to be related to what your post was about.
You need the FilteredWorksetCollector to gather the worksets. The line “for i in docs” is a for loop, and is allowing the script to iterate over a list of documents, so yes it is essential for the script to collect worksets from multiple documents in the directory,
The Document.Worksets node (shown in your attached image above) is not needed if you are using the Python script to get an output of worksets (your list in the codeblock) and their documents (your list in the codeblock to use with Application.CloseDocument)
The script I attached above should work.