In classical optics, the scattering of a wave off a barrier depends on the size of the barrier and the incoming wavelength.
Knowing the wavelength, you should be able to work out the size of the barrier - it is a common teaching lab experiment.
The equation should work for any wavelength - it's just that the ones that are comparable to the size of the barrier give easy to measure patterns.
When you use the same model to find the "size" of an electron, you get different values depending on the wavelength of the incoming light. So it appears that different kinds of light see different sizes for the electron ... or: the classical model has a flaw in it ;)