Try
getText() on the following locators:
For XPath: id('warningImageContainer')/following-sibling::p
For CSS: img.warningImageContainer + p
Now, if you have multiple elements that match those locators (when tested via FirePath for Firefox, etc.) then you have a separate problem on narrowing down to the desired element. And a complete dump of an example page source would be helpful as the current HTML is too sparse to tell if locator will work well or not.
And if you know the specific text you're looking for already or at least part of that text (a text pattern), you can do something like this in XPath:
//p[contains(text(),'4026-username already in use')]
which will match if such error occurs, and you can simply do a verify that element exists and not even have to do getText(), unless you need the text. Now, if 4026 was dynamic/changing, then you can omit it in the contains matching above and it will still match and getText() will then give you back text with the 4026 in it.