Depths between two element array stim objects

I’m trying to make an array of complex objects that are composed of two solid vertical bars and a drifting grating in between. See the screenshot below:

However, because i’ve coded the vertical bars and the drifting gratings as two separate element array stim objects, the vertical bars are all on top of every drifting grating - this is not ideal because the associated bars and gratings should be considered a unitary “object”. Is there a way to interleave the depths between two element array stim objects? I have tried defining “depths”, but the error message I get is:

Traceback (most recent call last):
  File "C:\Users\andre\Desktop\moving mondrian.py", line 24, in <module>
    bars = visual.ElementArrayStim(window, nElements = numPieces*2, elementTex = None, elementMask = None, units = 'deg', sizes = [.2,1], xys = positionsBars, colors = colors, depths = depthBars)
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\contrib\lazy_import.py", line 120, in __call__
    return obj(*args, **kwargs)
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\elementarray.py", line 163, in __init__
    self._updateVertices()
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\elementarray.py", line 614, in _updateVertices
    verts[:, 2] = self.depths + self.fieldDepth
TypeError: can only concatenate list (not "int") to list

This happens whether I give the depths paramater a list of numbers (for example, [0,1,2,3,4]), or a list of list of numbers (for example, [[0],[1],[2],[3]]. I also see that the “depth” parameter is pretty much depreciated across the board.

Is there any way to accomplish what I’m trying to accomplish with element array stim? If I could specify different textures/masks for each element then that would work as well. Ultimately, what I want to create is a complex object that has a drifting grating sandwiched between two stationary bars, and I want that complex object to be randomly tiled across the screen.

Here is my current example code. Note that I haven’t made the gratings drift yet.

from psychopy import visual,core
import numpy, random


numPieces = 20
pieceSize = 50



window = visual.Window(fullscr = False)

depthGratings = list(range(numPieces))
positionsGratings = (numpy.random.random(size = [numPieces,2]) * 300) - 150

positionsLeftBar = positionsGratings - [.5*pieceSize, 0]
positionsRightBar = positionsGratings + [.5*pieceSize, 0]
positionsBars = numpy.concatenate((positionsLeftBar, positionsRightBar),axis = 0)
depthBars = depthGratings + depthGratings

colors = [[1,1,1],[-1,-1,-1]] * numPieces
random.shuffle(colors)
colors = numpy.array(colors)

bars = visual.ElementArrayStim(window, nElements = numPieces*2, elementTex = None, elementMask = None, units = 'pix', sizes = [.1*pieceSize,pieceSize], xys = positionsBars, colors = colors)#, depths = depthBars)
gratings = visual.ElementArrayStim(window, nElements = numPieces, elementTex = 'sqr', elementMask = None, units = 'pix', sizes = [pieceSize,pieceSize], xys = positionsGratings, colors = [.2,.2,.2], sfs = 4)#, depths = depthGratings)

gratings.draw()
bars.draw()
window.flip()

core.wait(5)