The pre-1950s focus was on entrance into “a new world of hope and communal solidarity”, whereas the post-Stonewall Riots overtone was an exit from the oppression of the closet.[15] This change in focus suggests that “coming out of the closet” is a mixed metaphor that joins “coming out” with the closet metaphor: an evolution of “skeleton in the closet” specifically referring to living a life of denial and secrecy by concealing one’s sexual orientation. The closet metaphor, in turn, is extended to the forces and pressures of heterosexist society and its institutions.
https://en.wikipedia.org/wiki/Coming_out