Error: The socket has been shut down

Line 802 in source above shows the query is filesets UNION folders and symlinks.
I can’t quickly find a statement on precedence, but maybe it runs left to right, thus:

(expected filesets folders and symlinks EXCEPT filesets) UNION folders and symlinks

thus

I tried using parentheses to set order, but got a syntax error. I’m sure there’s a way.

EDIT:

I tried adding a SELECT * FROM before my previous parenthesis addition. Result:

image

EDIT 2:

Fiddling with the query, first by ORDER BY “Path” then faster AND “Path” IS NULL:

image

FilesetEntry table thinks it has a FileID 3838716:

image

FixedFile table doesn’t. I wonder how old DB is?

image

Local database describes some of the relationships.
Database rebuild and neighbor posts add some text.