In this paper we show that the diffraction condition for the scattering of atoms from surfaces leads to the appearance of a distinct type of classical singularity. Moreover, it is also shown that the onset of classical trapping or classical chaos is closely related to the bifurcation set of the diffraction-order function around the surface points presenting the rainbow effect. As an illustration of this dynamic, application to the scattering of He atoms by the stepped Cu(115) surface is presented using both a hard corrugated one-dimensional wall and a soft corrugated Morse potential