What happened

Harmony Gold Mining (HMY 0.69%) stock plunged 9.6% at its lowest point this week, according to data provided by S&P Global Market Intelligence, before regaining some ground the last day. As of 2 p.m. ET Friday, the gold stock was trading nearly 5% lower for the week.

So why did Harmony Gold plunge earlier in the week, only to rebound later? Multiple factors were at play.

So what

At midweek, UBS analyst Steve Friedman downgraded Harmony Gold stock's rating to neutral and slashed its price target to 47 South African rand per share from 61 ZAR a share, according to TheFly.com. The analyst is cautious about the gold miners' earnings and cash flows in the medium term, especially after its poor results for the year ended June 30. Friedman further highlighted Harmony's high costs and pointed out how they had eroded its margins and could remain high in fiscal year 2023.

Harmony Gold released its full-year numbers on Aug. 30, reporting an almost 17% jump in its all-in-sustaining cost to $1,709 per ounce of gold. Its revenue barely moved 2% higher. The gold miner incurred a net loss of around $48 million in the year versus a profit of $326 million in the previous fiscal year, partly because of an asset impairment.

Harmony Gold's final dividend per share for the year fell as well to $0.013 per share from $0.018 a share as the gold miners' dividends are directly linked to its cash flows, which fell sharply in fiscal 2022.

Now what

While the analyst downgrade and dismal projections for Harmony Gold hit its shares earlier in the week, a rebound in gold prices on Friday helped lift the stock. Gold prices rose to their highest level since late August on Friday as the U.S. dollar continued to drop against rivals and the market's expectation of a large interest rate hike from the Federal Reserve grew.

Given Harmony Gold's high costs, it requires higher gold prices to grow its top line to offset part of its costs and boost its earnings and cash flows. With gold prices inching higher on Friday, some investors saw an opportunity to buy Harmony Gold stock on the dip.