Seems like stamina is removed instead of added but if it dips below 0 because it that it rolls back to 500+ (which might just be the maximum value, I'm not sure).

I've abused this once as compensation for all the stamina I lost from this bug yesterday. Surely they're not going to ban us over this, right?