You need to transfer funds to meet the margin shortfall even if you have already closed your positions because the Clearing Corporations (CC) monitor margin requirements throughout the day based on four random snapshots. The CC considers the highest margin requirement from these snapshots as the peak, and you must meet this requirement. Otherwise, a margin shortfall occurs.
Even if you close your positions, a shortfall can still occur if the CC has already captured a snapshot with the highest margin requirement. To prevent an upfront margin penalty, you must add the necessary funds on the same day to cover any margin shortfalls. Zerodha mentions the shortfall amount in the email sent to you.