Named Queries in script escape tag paths wrong

I have a strong feeling it’s an escape problem because I had a similar problem solved (named-queries-syntax-error-when-passing-tag-path-strings.

My query is: SELECT NiceName FROM my_tags_mapping WHERE TagPath = {tagPath}

and the tag path can be anything like “[default]/Edulent/Giroste/Giroste1_Met01EnergyImm”

and yes the query works ok in the testing tab as is.