Can a Physically-Settled Futures Contract Be Closed out before Expiration?

Yes, the vast majority of physically-settled futures contracts are closed out before expiration. Traders close out their positions by taking an opposite and equal trade ⎊ a long position is offset by a short trade, and vice versa.

This is known as "offsetting." Only a small percentage of contracts are held until the "first notice day" or "last trading day" for the purpose of actual delivery.

What Is the Significance of the “Last Trading Day” for a Futures Contract?
What Is the Significance of the “Last Trading Day” in a Physically-Settled Futures Contract?
Does the Mark Price Ever Equal the Last Traded Price?
What Is the Process Called When a Physically Settled Contract Is Closed before Expiration?
What Triggers an Intra-Day Margin Call?
How Does Hedging with a Derivative Reduce Risk for a Business?
How Does the Concept of “Last Trading Day” Differ from the “Final Settlement Day”?
Can a Physically-Settled Contract Be Closed out before Expiration?