This is called a “race condition”, I documented this behaviour here:
As you can see, currently Wappler has no built-in protection for this. You’d need to wrap your queries in a database transaction or perform the calculation directly in the SQL query - either way through a Database Custom Query
If you’re using MySQL/MariaDB you can ping @ Hyperbytes, he might be able to help you