Need help with expected identifier error on where query

I know this should be easy. I’ve read the numerous descriptions of the expected identifier errors and cannot identify where I am doing something wrong. I’m using the Chronograf data explorer to, well, explore the dataset and cannot get past this error!

This group by query works as expected and displays two separate and appropriately labeled series on the graph. I am also able to type MIBB011189 into the search field on the chart and correctly filter only that tag’s series:
SELECT mean("energy") AS "mean_energy" FROM "dunbar"."autogen"."inverter" WHERE time > now() - 12h GROUP BY time(:interval:), "serial" FILL(null)

Whereas, when I attempt to use Chronograf’s data explorer to filter the query by selecting either of the two available fields it provides (which appear the same as the labels from the group by chart) I am given the expected identifier error.
SELECT mean("energy") AS "mean_energy" FROM "dunbar"."autogen"."inverter" WHERE time > now() - 12h AND "serial"='MIBB011189' GROUP BY time(:interval:) FILL(null)

When attempting a similar query but filtering it on a different tag, again using the Chronograf interface to select the specific tag to filter, it does work.
SELECT mean("energy") AS "mean_energy" FROM "dunbar"."autogen"."inverter" WHERE time > now() - 12h AND "location"='warehouse' GROUP BY time(:interval:), "serial" FILL(null)

I could really use some guidance as to what I’m doing wrong here because I am having a lot of trouble identifying the issue.

I am making progress identifying the issue. The data is being uploaded to InfluxDB through a Node-Red InfluxDB batch node. When I provide simply hardcode a string from its function node using the string I copy/pasted out of Chronograf:
tags:{ serial: "MIBB011189"}
The data explorer shows a second (albeit identical to my eyes) selector box for that tag. Choosing the first of the two maintains the same expected identifier error whereas the new, otherwise identical, second one allows the query to succeed.

The source of the tag which is not working is (I thought it was anyway) a string generated by parsing a buffer:
invSerial = msg.responseBuffer.buffer.toString('ascii',0,16);

and sent to Influx using:
tags:{ serial: invSerial }

So not likely the failing in InfluxDB, but more likely somehow being encoded wrong getting to InfluxDB.

While I never could figure out the source of the errors, I was able to “cleanse” the string using a regex:
invSerial = invSerial.replace(/[^a-zA-Z 0-9]+/g,'');

Now the tags work as expected.

@arriflex, Glad you were able to solve the issue!