Removes the element at the index. If the index is out of bounds, then a copy of the array is returned.