When you create the family object "SpaceMap" it doesn't automatically know which object, you need to create the specific object by name. You store the name of the object in the array but then try and create the family instead. You can create array.at(loopindex,0) or however the values are stored in the array by row/column.
Pick last created Family can still be used but may not work in the same tick and loop. It may need to be triggered elsewhere but you can test this.
The array deletion row you don't need to cycle through the array again as you are already at a row in the array and can delete the current row 'loopindex'. The problem with this however is that rows will move up and some objects will be skipped, to resolve this sometimes you can run reverse through the array from bottom to top.
I saw you create a probability table but don't use it?