Function returning nil even when the return isnt nil

So my function loops trough multiple tables to find a certain key, once it finds it, it returns it. Somehow when i return it, the value goes to nil even tho the value is not nil when i print it in the loop

Heres the code:
and heres the output

You have to propagate the return value from the nested function.

return deepSearch(SlotData)
1 Like

Thank you for helping me on this!