Try removing one of your levels of enumeration. If you have a list like this:
IN = [[[1, 2, 3],
[4, 5, 6]]]
IN[0] removes the outermost layer of nesting:
[[1, 2, 3],
[4, 5, 6]]
Finally, iterating whichever variable you assign IN[0] to would give you two lists of 3 integers: [1, 2, 3] and [4, 5, 6].
What’s happening is that you’re finally getting down to the individual objects stored in the list, which would be an int in my example, therefore raising a TypeError, which would be 'int is not iterable' here. Writing a recursive function would be a more scalable approach for your use case.
I’ll look into that recursive function. Right now I just needed a fairly simple one, but it would perhaps be a good moment to have a deeper look at recursion.