This bug still exists in the 1.5.1 source code.
If there is a byte array defined, the name of the element isn't used to look up the element from the "beanElement". The OMElementImpl#getFirstElement() method is used. There is a good chance that the byte array won't be first.
Both 3538 and 3765 have proposed solutions.