NAV version : 2018
Costing method: Average cost
When running adjust cost for only certain items getting error at per attached

The NAV has manufacturing setup and the error is being displayed only for certain finished items
We have tried to run the adjust cost for only one item but still getting the error.
We have already done the following as proposed in other blogs but same error:
1) The manufacturing setup is set to 'Dynamics low level code'
2) The process 'Calculate low level code' has been run before running adjust cost
3) run adjust cost for the raw materials and then for the finished goods
The items where we have the error have on average 400,000 entries in item ledger entries.
Thanks to advise what can be done to avoid the error