ArgumentOutOfRangeException despite boundary checks
<p>I have created custom button in winforms in which i've added property with a list of custom class: <code>List&lt;Zasoby&gt;</code> and a method to add item to this list only when there is already item in that list that meets specific criteria (the lambda .where expression).
The class <code>Zasob</code> is serializable.
And in designer i add first Zasob to the list in this button like this:</p>

<pre><code>bt01008xxx.Zasoby.Add(new Zasob { Lokalizacja = new Lokalizacja("01", "008", "000") });
</code></pre>

<p>..</p>

<pre><code>public class ZasobSzczegolowoButton: Button, IAddZasoby
{

    private List&lt;Zasob&gt; _zasoby = new List&lt;Zasob&gt;(); //{ new Zasob { Lokalizacja = new Lokalizacja("01", "001", "000") } };


    [EditorBrowsable(EditorBrowsableState.Always)]
    [Browsable(true)]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
    [Bindable(true)]
    public List&lt;Zasob&gt; Zasoby
    {
        get { return _zasoby; }
        set
        {
            _zasoby = value;
            if (_zasoby.Any()) BackColor = _zasoby.Sum(x =&gt; x.Ilosc) &gt; 0 ? Color.Coral : Color.White;
        }
    }

    public void AddZasoby(List&lt;Zasob&gt; zasoby)
    {
        var buton = Name;
        if (_zasoby != null &amp;&amp; _zasoby.Count != 0)
        {
            var szukaneZasoby =
                zasoby?.Where(
                    x =&gt;
                        x.Lokalizacja.ObszarKod == _zasoby[0].Lokalizacja.ObszarKod &amp;&amp;
                        x.Lokalizacja.Segment1 == _zasoby[0].Lokalizacja.Segment1);
            if (szukaneZasoby == null) return;

            Zasoby.Clear();
            Zasoby.AddRange(szukaneZasoby);
        }
    }
}
</code></pre>

<p>...</p>

<pre><code>[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate,Inherited = false)]
[ComVisible(true)]
public class Zasob : Attribute
{
    public Towar Towar { get; set; }
    public Magazyn Magazyn { get; set; }
    public Lokalizacja Lokalizacja { get; set; }
    public decimal Ilosc { get; set; }
}
</code></pre>

<p>Now whenever i try to use method AddZasoby i get System.ArgumentOutOfRangeException. I check the list for null and count items and in debug mode and it shoud exit method but still somehow ends up in the body of the method with the error. (please see the screenshot below)
Any idea what am i doing wrong?</p>

<p><img src="https://i.imgur.com/8g68G0u.png" alt="1"></p>