Query with nested tags not working

Background and problem

I’m coming from Roam. Due to lack of namespaces in Roam I used to have projects like:

[[[[Projects]]-Personal-Misc]]
[[[[Projects]]-Work-Misc]]

In Roam I could easily query all tasks under nodes tagged with these projects using

{{[[query]]: {and: [[TODO]] [[[[Projects]]-Personal-Misc]]}}}

I imported Roam to Logseq and tried to to replicate this in two ways, but neither approach is working:

Approach 1: keep the same tags and replicate the query

{{query and ( (task now later todo doing) ([[[[Projects]]-Personal-Misc]]) )}}

The result is completely unexpected - it’s finding blocks that aren’t even tasks.

Approach 2: convert to namespaces

Convert [[[[Projects]]-Work-Misc]] to [[Projects/Work/Misc]] and run this query:

{{query (and (task now later todo doing) ([[Projects/Work/misc]]) )}}

This query is finding tasks, but it finds a bunch of tasks that aren’t in the project.

Any idea why this may be happening? Thanks in advance! :pray: