Why is the COGS recognition accounting entry missing or not created for sales order issue or RMA receipt?
If the automatically created invoice corresponding to a sales order isn't available and you've replaced it with a manual invoice referencing the sales order, then Cost Accounting wouldn’t be able to match the sales order to the revenue lines.
As a result, the COGS Recognition accounting entry isn’t created and you must manually create the journal entry for this. This is also applicable in the case of an RMA receipt if the credit invoice is similarly manually created.