Hi @Geool
Looking at the debugger will show the exact input that was passed to the query at the time that prestahop_get_budgets returned undefined, but if it's more of a timing issue, it could maybe be helpful to test with a smaller amount of data in arr. For example, does it work more consistently if you only trigger 25 api calls?
For solving the timing issue, it might be helpful to add a delay between each run or do the get requests in batches. This community post has some code that may help!