Widely used systems like EPIC have bugs and quirks that have existed so long that the bugs themselves have become their own standard. Because HL7 relationships typically happen between longterm consistent partners both parties tend to evolve the format to suit localized needs and this business logic and the reasons for it are lost to time. It isn't that rare to find HL7 interfaces that have been in use for 20+ years that have become vital black boxes. HL7 2.x, still widely used, was originated in 1989.
In a lot of case modernization like FHIR is nothing more than taking the old garbage and putting it in a new fancier bag.
As whacky as HL7 may seem it is really nothing compared to its much bigger uglier older brother, X12 837/835, used for communication of billing information from performing entity to insurer.