so in this scenario..

stock by attributes is installed

I have set a particular product to maximum quantity = 1
The size large has a stock level of 0
the size medium has a stock level of 1 or greater

the user adds the large to their cart, they get informed the item is out of stock.

They go back and add the medium to their cart, the medium is removed from their cart because the maximum number of this item has exceeded 1, but the item it has left in the cart is out of stock.

I would recommend a small piece of logic is written, that when deciding which item/s to remove from cart that if one of them is out of stock it is the first candidate to be removed rather than just selecting the latest item to have been added.

Flamer.