I have a function that used to work, now it suddenly stopped

I have a function that used to work, now it suddenly stopped

I have 4 functions in total that are coded very similar, 2 of them work fine, the other 2 worked until recently. I am attaching 2 files, 1 is the code that still works, the other doesn't work anymore

I know the code is good in the one that doesn't work, because when I switch out the API names it works again. so I can only conclude that it has something to do with that, but I just can't figure it out

any advice is greatly appreciated.