My patch indeed breaks things – touching semantics of cleanupFeedbackmessages() is not a good idea as feedback messages also serve to signal FormComponent's validity. WIth my patch, FormComponents that failed to verify during an ajax request, are treated not valid until the error message is actually displayed to the user. This results in displaying error messages on submitting correctly filled in Form.
The problem I originally reported is exactly what Martijn said: "a normal form submission and an ajax event that are fired at the same time, where the ajax request is canceled with an EmptyAjaxRequestTarget (because normal page processing is already in progress). When the RC.detach() is processed, it clears all feedback messages."
Cancelling an ajax request because normal page processing is in progress seems like an intentional no-op, and it should be. Cleaning feedback messages is not a no-op though.