What does the POH for the 172 in question say about slipping the aircraft with 40 degree flaps set?
I only have the C182's in front of me but to quote (and this would probably be the same for the C172) "Steep slips with flaps settings greater than 20 degrees can cause a slight tendency for the elevator to oscillate under certain combinations of airspeed, sideslip angle, and center of gravity loadings".