This is not an optical illusion. It’s a confusion.
When you cover the contrasty edge with finger, you start comparing the light part of one form with the shadow part of another. It is wrong, even if the tone is the same. Well, we should compare that relations when drawing, but they are secondary.
The objects ARE actually different in color. Compare the parts which are lit with equal amount of light and not the parts which are lit differently.