Hi Michael,
I noticed that you use Scrap Quantity (AMGLG) from structure MCCOMP (Material Components). Can you please try to use Scrap Quantity (PAMNG) from structure MCAFPO (Order Item) instead?
What ECC release and SP level are you working on?
Best regards,
Sander