Try to use parameters in all 3 cases. Then it should be more consistent.
WHERE t.name =~ {regexp}
params: {regexp: "(?i).*\\baaaaaaaa\\b.*"}
It is the different escaping that happens when you use JSON vs. literal strings in Java, and the Cypher parser so either 2 or 3 different parsers at work each of them having its own understanding of escaping.
In plain Java, afaik it is two backspaces for regexps.