Physics2D.OverlapCircleAll not always working 100% of the time

I am making a 2d color matching puzzle game with rigidbody2d and circlecollider2d. Everything works fine except that the collision does not always work.

I think the problem might be with how OverlapCircleAll is working. Here is my code for the ColorBubble class where i deal with the collision color matching in Update(), btw I tested it in FixedUpdate with not much difference

Collider2D[] colliders = Physics2D.OverlapCircleAll(transform.position,.5f,mask,Mathf.NegativeInfinity,Mathf.Infinity);

		foreach(Collider2D c2d in colliders)
		{
			if(c2d.gameObject.GetComponent<ColorBubble>() != null)
			{
				ColorBubble b = c2d.gameObject.GetComponent<ColorBubble>();
				
				if(b.color == color)
				{
					matches.Add (b);
				}
			}
		} 

I heard that it might have something to do with the Z axis. In this post someone said the OverlapCircleAll ignores colliders with the same z axis. Is this really true? I know it has nothing to do with how i set up the color variable or the layermask because I checked those and they work. Most of the time the colors match correctly but sometimes they just do nothing when they hit.

Its more likely that your color equivalency is not firing correctly. Colors are floats, and there is potential for precision error every time you compare floats. And you are comparing four of them.