Seams to be working fine in all my tests. You need to ensure your query is absolutely valid and the query validation is configured properly. For example the following query validation will error if I input a firstname that already exists.
Query:
Code:
SELECT COUNT(*) FROM `#__comprofiler` WHERE `firstname` = '[value]'
Validate On: Empty Results
Ajax Validation: Enabled
Ensure CB Query Field is published within CB > Plugin Management.