@PabloNeruda, are you able to get the value of your selection displayed on message box pop-up? What do you see there?
Error message logic works for all input forms, OOTB and custom, equally. Maybe something else in your form is not letting the leave tag execute properly. Could you share more details...