Flyback converter role of diode in parallel to primary windings
This is a snubber circuit. Together with R3 and C3 the diode catches some or most of the ringing on the primary side and burns the excess energy in R3. D2, D3 and D9 are part of it as well and clamp the maximum voltage.
More about it here: Wikipedia snubber