It looks like that dbapp.temp_table contains two rows for at least some Invoice_Id, Item_Nr combination
select Invoice_Id, Item_Nr, count(*)
group by 1,2
having count(*) > 1
So you either have to agg the two rows into one or you have to run the two updates.