Indeed the query I gave was an oversimplified one. It did give the results but not as refined.
To get the expected results, you don't really need to make the query as excessive as above.
Please try the query below
SELECT * FROM [dam:Asset] AS s where isdescendantnode([/content/dam/mycompany/catalog]) and s.[jcr:content/renditions/*] is not null and s.[jcr:content/renditions/product-details.png/jcr:primaryType] not like '%nt:file%'
This query basically checks if the renditions exist for an Asset AND any asset which might have the missing product-details.png rendition.
I tried the query given by you but it's not returning any results.
My requirement is to find the image nodes which don't have product-details.png image rendition.
The logic in your query is saying to return all the renditions other than product-details.png which will not give the correct results.
Suppose one of the renditions folder has this rendition. Due to the above query, all the renditions other than product-details.png under that folder will be there in result which is not the requirement.