When is an exception message too big?

I'm testing a web app that has a cumbersome exception message for attempting to add non-eligible invoices to a payment system, see the image below. The developer sees no issue with this but its clearly awkward looking. Is there a good reference for current standards on how a message like this is designed? Common sense would suggest you create a generic message that doesn't include actual data tags to keep the message predictably sized.

enter image description here