Consider a perfect conductor that encloses a spatial volume such as a parallelepiped or cylinder. If we solve Maxwell's equations inside that volume, seeking solutions that depends on time with a dependency of the form $e^{-i\omega t}$, we find that only TE and TM modes can exist inside of that volume (and no TEM modes). However both TE and TM modes have a cutoff frequency. This seems to imply that any EM wave inside the cavity cannot have any frequency and that it should be greater than a threshold.
However if we look at the problem from another perspective, the one of a black/grey body at a temperature $T > 0K$, we'd think that the walls are emitting EM waves without any cutoff frequency (and with a continuous spectrum).
I understand that the sum of two solutions to Maxwell's equations in the cavity is also a solution and I think that I could write any allowed EM wave as a sum of TE and TM modes, but if both TM and TE modes have a cutoff frequency, I don't see how I could obtain an EM wave with a lower frequency that the cutoff one.
Hence I don't see how to reconciliate the blackbody radiation with TE and TM modes inside a cavity. Where do I go wrong?