Hi Arjun,
I wonder if your multicore structure is the problem. The way the query is written, it will only look at the direct parent multicore. In your case, it would need to traverse higher (the parent of the parent).
I have a feeling that this is going to require a custom query (plugin) to achieve what you need. Is this something that you have the license/capability for?
Simon