Equity shares for delivery follow a T+2 rolling settlement cycle, where T = Trade Day.
When shares are short delivered on T day, it is settled on T+3 day after the auction market.
Shares bought on T and sold on T1 - Risk of Auction for a BTST trade
Lets say the shares you bought on T day are short delivered by the counter-party(The seller of the shares did not possess the shares while selling it and seller was unable to buy back the shares sold to you). You will receive the credit of these shares into your demat account only after auction settlement by the exchange on T+3 day. The person who sold the shares to you and short delivered it will have to pay an auction penalty which will be the difference between the auction buyback price and his shorting price.
Now when you sell the shares on T+1 day(BTST), you will not have these shares in your account on T+2 day. When shares are sold from your demat, the exchange will monitor on the next day if these shares are available in your demat. Since the shares will not be available in your demat on the next day, you will end up short delivering. Hence, you will have to buy these shares back from the auction market in order for it to be settled.