Not sure if this will help in your case but I ran into something where I needed nested operators like this
const bPromise = wixData . query ( “Meals” ). hasSome ( “time” , “Breakfast” )
. not ( wixData . query ( “Meals” ). hasSome ( “allergens” , $w ( ‘#allergies’ ). value ))
. find (). then ( ( allMeals ) => { return allMeals }
the .not contains a subquery perhaps you can do something similar by having 1 outer setfilter that contains the or, with a sub setfilter inside each