The random functions in MATLAB generate random numbers, not select a random value from a supplied vector.
What you could consider doing is creating a vector of the rectangle handles, and then randomly generate an index to extract one of them. That might look somethign like this
y = [lower_l, lower_r, upper_l, upper_r];
idx = randi(length(y));
set(y(idx), 'EdgeColor', 'r')
set(y(idx), 'EdgeColor', 'k')