v3.5 (and earlier) - Expression Evaluation Errors

I get occasional expression evaluation errors in the module that I am working on.
This one comes from a Restricted Command expression (I’m not sure if this is always the source, I do have a lot of Restricted Command use in the module).

  • Bad Data in Module: Expression evaluation error Expression={Count("{LocationName=="$LocationName$" && Type==“Marker”}",“Main Map”)==0 && prefRestrictOff!=true}, Error=Method Invocation _interp.count

The error seems harmless; the restriction is still working correctly, I think.

Is there something wrong with the expression that I’m not spotting ?