Before this action you need to open bps the right way. Do you have your mainbp open when it goes to depot? Also have you written the looting destinations name right? Both variable name and backpack!
If you use Brown Backpack as main bp. Test to write "brown backpack" in looting destiantion instead of only backpack. and if you have written "brown backpack" test just backpack.
Tell me if this fixes it!
EDIT---------
Your code misses an end in the second while loop. Sure this action haven't throwed errors? Just put end on line 21!