Some queries need extra parentheses around NOT conditions to work correctly. Without them, the system can’t understand the query. 


Working Example: 

ID IN (select QuoteId from QuoteLineItem where Product2.Family = 'port' AND (NOT (Product2.Name LIKE '%connect%')))


Please note: The SOQL used in Mass File Download depends on the Dev Console query editor. If you paste a query from the inspector directly into the Advanced Search (SOQL) without enclosing the NOT condition in parentheses, it may result in a parsing error. After enclosing the NOT condition in parentheses, the query should run successfully.