I don't remember exactly when, but warning messages started to show up in a new window.
I found a post about this
The poster gives us solution - change an option in the preference.
But such option (Messages tab) doesn't exist in mathematica version 12.
How can I show warning messages between In and Out in mathematica version 12?