I think "Array contains value" scans the entire array, you should not use it inside the loop. Try this:
For each XY element
Array Value at (Array.curX, Array.curY)=KeySlots.UIDofDoor
---> Array delete index Array.curX
You can also do this with normal "For" loop:
For "x" from 0 to array.width-1
Array Value at (loopindex, 1)=KeySlots.UIDofDoor
---> Array delete index loopindex