Yes it does return true. The extra # is indeed part of the prefix. As I have to change the uri’s in order to not disclose anything here, I forgot that character.
Usually this kind of problems happen when there’s a mismatch in IRIs somewhere. If ASK with the exact same WHERE returns true then DELETE must delete the triples (well, unless you have something like named graph security preventing updates to that named graph).
We’d need a test case to reproduce the problem to investigate further. I understand you cannot share data but maybe you can share it in the obfuscated form (Stardog can turn all IRIs and literals into md5 hashes).
The issue is fixed. I had 2 issues, a typo in the query generated in my code and the user that executes the query from within my code did not have the correct DELETE grant.