While ambient smells shouldn’t penetrate wine corks and ruin your bottles, a dedicated wine fridge is preferable to a closet.
Depending on how close you place your rails together, it also makes a pretty privacy fence idea ... for a mix of bottles with interesting shapes, colors, and patterns like wine and alcohol ...