Say I have the card limit set to 20. If I fail (status 0,1,2) 10 cards, I'm now studying at least 30 cards in that session, of which many may be new (which I might fail too) and this can go on forever. The failed cards should be counted to the session limit, as after I "OK"ed them I will have precisely 20 (= the limit) cards studied.
In other words, the cards to be studied should behave as if they were chosen before the session starts and no other cards could go into it. With the current behaviour I can study arbitrary amount of cards if I first fail all of them.
As a point of reference, Anki behaves like the above.