It seemed your Cost Manager may not be active, or you are using a costing method that mandate transactions to be costed in order and the first record might be in error.
To check whether the cost manager is active, go to: Inventory responsibility > Setup > Interface Managers, Cost Manager must be active. If not, launch it from Tools > Launch Manager
To check whether there are records that are un-costed in error, run query: select count(*) from mtl_material_transactions where costed_flag = 'E';
If all of these have been checked, and you still have uncosted records, open an SR with Inventory Support team, product 508, subcomponent Transactions to seek further assistance.
Hope this helps.