It could be that in the Desktop mode, SELECT is pulling different rows (could be including the row in the current form) than those pulled in the current mode (what is in the google sheet before sync).
Try displaying the result of the SELECT statement and see what is happening.
the problem is that it calculates the current used leave in the annual leave form twice in desktop mode. accepts the sum of the previous used permissions as if the used permission on the linked form existed before.
Create virtual columns in table, and put parts of your formula (or all the formula) in these virtual columns…for testing purposes only, to see where are the diferences.
Desktop View is currently a preview feature and under active development. Preview features are not yet suitable for use in important apps. Until it has achieved greater stability, I recommend against using this preview feature except for testing and to help the AppSheet developers in their efforts. To follow the progress of and contribute to the development effort, please visit this dedicated Community topic: