nostr:npub1f8e6w3kg6cptk4ljl09ua3vezr7gws4jcuwyvzdnpytsnlp2yd6savzu5u I just wanted to let you know that single quotes make it a string literal in spite you were probably looking for double quotes which allow you to do what I think you were going for. Hope you figured that out and or this was a typo and you didn't spend all this time poring over what was wrong cause otherwise I think you're fine.
By the way instead of nested selects have you considered reformatting that into a CTE? Might help you with readability later.