My matplotlib's version is 3.9.3 and the code below works fine for this color change case.
selector = RectangleSelector(
ax, onselect,
useblit=True,
button=[1], # Respond only to left mouse button
interactive=True,
minspanx=5, minspany=5,
spancoords='pixels',
props = dict(facecolor='red', edgecolor = 'white', alpha=0.2, fill=True)
)