How does wing flex reduce wave drag?
No, it is torsion which reduces wave drag.

The sweptback wing will twist as well as bend, and this twist will reduce the local angle of attack, and with it the suction peak on the top side of the wing. The same mechanism twists the outer part of a forward swept wing to higher angles of attack, necessitating a stiffer structure to avoid aeroelastic instability.

Air will not "see" any difference in wing thickness, regardless of the dihedral or bending. For air, there is no difference between a wing and a vertical surface (which would have almost infinite thickness following your assumption, but obviously doesn't).