All software development in the field is exactly like this.
There is always an existing system your code has to fit into.
There are always borderline real world cases that ruin your streamlined architecture.
This *is* what software development actually *is*.
The dev part is "changing what is already there" to make it fit.
The ops part is "not disturbing the money streams" while you do this, and keeping the city alive around you.
This is what you need to identify the actual stakeholders, extract the actual requirements, and to find the missing documentation.