This is what’s happening in highly complex software over time. Every larger system has corners like this.
I’ve worked on a system that required that you send invalid XML, because some bloke 10 years ago didn’t know what he’s doing and hardcoded a certain structure.
Easy fix, but our clients relied in the old behavior, and nobody bothered fixing it.