Unexpected token while parsing selector error

Hello all,
I am having trouble using Get Element States keyword. This line:

Get Element States    //div[text()=' CODE 540001 ']   contains    visible 

Returns an error:

Error: locator.waitFor: Unexpected token “” while parsing selector “”

I will appreciate any tips. I had no luck with what I tried so far (double quotes in selector, adding parent element…).

Thank you and best regards,
JC

Edit:
I believe I caused this issue by setting selector prefix to ${EMPTY}.
I need this because I am switching in and out of iframe.
Everything worked great until I started using Get Element States keyword, so I will need to find a workaround for it.