By Joe Wallace

Gold prices wavered Wednesday, extending a volatile spell for the market as climbing yields on U.S. government bonds sap investors' appetite for the precious metal.

Futures contracts for delivering gold in December, which notched a record high just last week, slipped 0.3% to $1,940.80 a troy ounce in choppy trading. Prices moved in a wide range, between a low of $1,874.20 and a high of $1,956.40.

Silver futures retreated, falling 2.7% to $25.36 a troy ounce on the Comex division of the New York Mercantile Exchange.

The swings interrupted a historic rally in precious-metal prices, which have soared as investors sought alternatives to low-yielding bonds and a haven from the economic downturn caused by coronavirus. Most-active gold futures hit an all-time closing high of $2,069.40 a troy ounce on Aug. 6 and remain 27% higher than they were at the end of 2019.

Treasury yields have picked up in recent sessions, curtailing investors' appetite for gold and silver, which pay no income. Yields on 10-year Treasury notes were on course to advance for a fourth straight day Wednesday, lifted in part by the anticipation of hefty debt auctions by the U.S. government.

Investors are bracing for more gyrations in gold prices. One gauge of expected volatility, the Cboe Gold ETF Volatility Index, has risen 65% over the past month, though it is well below its recent peak in March.

Like the better-known VIX gauge that tracks volatility in stocks, the index uses options prices to calculate how far traders are expecting prices to move over the next month. The options aren't tied to gold futures directly, but instead to shares in the SPDR Gold Trust, the largest exchange-traded fund backed by physical bullion.

Adding to the choppiness in gold markets, novice investors sought to sell the metal the moment prices stumbled, according to Ole Hansen, Saxo Bank's head of commodity strategy.

"It was overdue, but probably now overextended," Mr. Hansen said of the reversal in gold prices. "The fact the correction was as deep as it has been was down to the fact there have been a lot of new investors entering the market in the past few weeks."

Mr. Hansen expects gold prices to resume their ascent, albeit at a slower pace.

"The reasons for holding gold and silver have not gone away at all," he said, citing stimulus policies by central banks that have depressed bond yields, as well as lingering uncertainty about the outlook for the world economy.

Gold futures have become less liquid in recent months, according to traders and analysts, meaning it is harder for investors to buy or sell the amounts they want for the prices they expect. Some players have dialed back trading activity due to dislocations between prices for gold in different locations and at different dates, exacerbating price moves.

In one such dislocation, contracts for delivering gold in December are around $16 a troy ounce more expensive than contracts for delivery in August. That gap is unusually wide, punishing investors who avoid taking hold of physical bullion in New York by selling near-dated futures and buying later-dated contracts.

Wednesday's decline put gold on course for its biggest two-day drop since mid-March, when prices plunged as investors sold the precious metal to raise cash during a period of turmoil in financial markets. In dollar terms, gold's loss of $93.40 a troy ounce on Tuesday was its biggest in more than seven years.

Despite the turbulence, many investors expect gold prices to keep rising as the Federal Reserve pins down interest rates and buys bonds to support the U.S. economy.

"People are looking for a place to put their money with yields at zero," said Joe Foster, a portfolio manager at New York-based investment firm VanEck. Prices could rise to $3,400 a troy ounce, according to Mr. Foster, whose fund invests in shares of U.S. gold miners.

Write to Joe Wallace at Joe.Wallace@wsj.com