Hello Katrine and thank you for reported issue.
The issue is not the received quantity, but its the Extra cost. When there is a batch number 123, it is a limitation that we cannot have qty 5 with cost x and qty 5 with cost y.
Do you maybe have ticked "Cost price for serial number" on item record, Item group or setting Cost accounting?