Not sure if you are aware of this so mentioning it for your reference.
Closing price is calculated as the weighted average price of the last 30 minutes. It can be different from the last traded price (LTP). You can read more about it here.
Market also knows that closing price is going to be the weighted average, so the option premium in last 30 mins is more inline with the weighted average instead of the LTP of the instrument (Nifty, BN, etc).
Hope that helps.