Rickard,
OK. Although you say you have an ATO scenario, it is not the same as what SAP calls ATO.
In general, you are relying on two different types of scheduling (basic plus detailed) to achieve your solution; in standard ATO there is only one (detailed). You also are apparently using ATO in some cases, but not ATO in others. I mention this not to say that these things are wrong, but only to say that this makes it difficult to troubleshoot from a distance, since I have no idea about the business requirements that caused you to arrive at this particular solution. I don't know what is changeable in your solution, and what is not.
As an experiment, in a sandbox, run the inhouse production time to zero, and make the selection of the routing mandatory. Ensure that your Schedule Margin Key allows no float before and no float after.
With these settings, under normal ATO, you would always have the MAD of the confirmed schedule of the sales doc be the same as the MAD of the production order. Tell me if this works in your customized version.
I am unfortunately occupied rather extensively with some project work this week, so it may be a while before I can again respond to this thread.
Best Regards,
DB49