In the case of the PNP workflow, the LineItemsPO table gets populated with the lines in the order that they are in on the Receipt Entry. As such, the CostPerCode will also be in that order. In your screenshots the lines may be displayed out of order, but the “Line” field is a match as you have displayed with the arrows. To use your example, this would allow you to set the "Line Items PO field group with the “Cost Per Code Group” values, where applicable.
As we know, there is no way to sort the field groups at this time. I am looking into this as per my other post: Sorting Field Groups - #9 by vleveris