The subprime-mortgage crisis has been a financial catastrophe for much of Wall Street. At Goldman Sachs Group Inc., thanks to a tiny group of traders, it has generated one of the biggest windfalls the securities industry has seen in years.

The group's big bet that securities backed by risky home loans would fall in value generated nearly $4 billion of profits during the year ended Nov. 30, according to people familiar with the firm's finances. Those gains erased $1.5 billion to $2 billion of mortgage-related losses elsewhere...