I am puzzled why this is happening. The only query field I have like that ( single column select/ multiple column custom output ) is an old field where I was doing:
SELECT `user_id`
FROM `#__comprofiler_plugin_invites`
WHERE `user` = '[user_id]'
LIMIT 1
, and then the custom display output I posted above, BUT I had set it to display only on Registration! Not profile or profile edit.
It's been a while, but I think I was trying to display the full name of the person who invited him when he registered, except of course, at that point he does yet have a user_id! So I don't think I was even using that field any more and I don't know why editting his profile in the backend would care. But at that point, he'd registered and the query returns the correct ID.
So just to check, I undid my fix in QueryField.php and unpublished that query field - and the error went away.