It did not come {out of nowhere} = it came {from somewhere} The phrase is grammatical and it means "Something caused it". When we say "That remark seemed to come out of nowhere" we mean that it was a non-sequitur; it did not seem to flow in any way from the conversation going on at the time. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.