Coinbase Prime Negative numbers

I am using the coinbase prime api to retrieve all transactions and create some reports. While parsing the inflows and outflows I saw that there is a case where the token amount goes bellow zero. At the end the balance of that token does not match the actual balance of the account.

If I change the negative balance into positive and continue calculating the the transactions the balance actually matches perfectly in the end.

Could someone please explain how this is possible?