shortage means the person from whom you have bought the shares (yup you do not buy it from your broker but from another person somewhere in some part of this world, the broker is just a mediaum) has failed to deliver the shares. the exchage i.e. nse or bse, as per rules and regulation penalise him for his default and rewards you for your lost oppurtinity.
basically you should get back your money and the penalty that the exchange charges the seller(the person who is liable to deliver the shares) as per the rules of the land.
errant broker usually buys back the shares after some days and delivers it to gullible clients (in this case its you) and pockets the penalty which is illegal. you can approach sebi or the exchange (nse or bse) for any redressal. just threat your broker that you will take the matter to the regulators and they will fall in line.
I think, as you mentioned, if the counterparty does not deliver on time, you should get a contract note paying you at least part of the penalty. Ultimately, you will get delivery.
My friend who has an account with Asit C. Mehta has got quite a few payments as a result of these auctions. Sadly, my broker, Geojit, has never paid me this way
, even though I sometimes don't get prompt delivery of shares I purchase.