Effect of direct exposure to sunlight on various drugs
Conversion of D to L isomer or vice versa is about the last thing to worry about in this situation, even if it may be facilitated by sunlight to a significant extent (which I doubt). Also, storage of chemicals in dark coloured bottles is by no means limited to compounds that have optical isomers, or even to drugs in general. Other examples are numerous; permanganate solutions and nitric acid come to mind.

Photons of visible light have pretty decent energy of a few eV. That's way higher than the energy of thermal motion at room temperature. When a molecule is hit by a photon, it is hit hard. If a molecule is fragile or strained in any way, it will probably break. Photons come in droves, and after a while your precious organic sample turns into a brown goo. (It would probably do so even in the dark, but that would take a bit longer.)

That's what's wrong about sunlight in the first place.