Etymonline does not mention exact phrase 'to turn out', but there is a short and simple entry for turn-out
"audience, assemblage of persons who have come to see a show, spectacle, etc.",1816
Macmillan lists the following, related meanings for the word turnout:
- the number of people who come to an event
- the number of voters in an election
Obviously, it would be hard to imagine that the word turnout was established before or independently of the phrase turn out.
However, it is possible to imagine that, similarly to nautical origin of 'turn in' - go to bed, there was a theatrical context in which the adverb out was added to the word. Once established as attendance or audience of a play, which is a result, the meaning could have been applied to any result of any event, even for small and personal events.
The above is a hypothesis, what follows is wild speculation:
Thinking about some translations of the phrases such as 'It turns out' to other languages, I came to a possible explanation why word out was chosen - the result of the show can be best measured by two things:
- the mood of people leaving the theater
- the number of people leaving the theater at the end of the show (and not before)
Both facts are established while people are going out of the theater - hence the word out and it seems compatible with the history of meanings. Here's a fictional dialog -
Q: "How was the audience last night?"
A: "When they turned up they were many but when they turned out, there were few and looked bored."
Another explanation might be that the word was established during outdoor theater performances and hence the out.