The difference between Planck's Law and the Rayleigh-Jeans' Law is, in Rayleigh Jeans, the average energy per mode is ##kT##, whereas in Planck, it is ##\frac{hc}{λ(e^\frac{hc}{λkT}-1)}##.

These average energy formulas are multiplied by another formula to give either Planck's Law or the Rayleigh-Jeans' Law.

This other formula is inversely proportional to ##λ^4##.

No. A cavity is only an approximation of an ideal blackbody described by Planck's law. The approximation is what's breaking down here; it doesn't work when the cavity is too small.

One of the assumptions in the derivation of the Planck's law is that the spectrum of possible energies is continuous. But the spectrum of an atom at rest is certainly not continuous. Nevertheless, the spectrum of realistic materials is usually quasi-continuous, i.e. discrete but with such a small energy spacing that this looks negligible. However, when the temperature is low and cavity small, then it is no longer negligible, the spectrum cannot longer be considered quasi-continuous, so the Plank's law becomes badly violated.