The "RETURN XML AUTO" format is designed to work with queries that use navigation properties instead of explicit joins. If you want to use that output format, the equivalent query using navigation properties looks like this:
SELECT B.NodeID, B.Caption, B.CustomProperties.Scripts, B.CustomProperties.Group FROM Orion.Nodes B WHERE B.CustomProperties.Group <> 'N/A' RETURN XML AUTO
Your existing query would work with the "RETURN XML RAW" format.
It's strange that your query is taking so long to run. Are you having poor performance overall? Or are things mostly fine but this one query is slow?
Thanks - Is there a way to output in JSON?