Isn't this what is supposed to happen? When you flush(), it runs validation again to make sure that all fields are valid as they should be, which may clear the markInvalid message. From the javadocs:

Code:

/**
* Marks this field as invalid. Validation will still run if called again, and the error message will be changed or
* cleared based on validation. To set a error message that will not be cleared until manually cleared see
* {@link #forceInvalid(String)}
*
* @param msg the validation message
*/
public void markInvalid(String msg) {

Do you perhaps mean to be calling forceInvalid instead, or adding a Validator to the field?