Raycast randomly hitting and not hitting...?

My raycast is going right through my meshes quit often. In the picture below the origin is NOT moving, is NOT inside the collider, and is layermasked to ignore the player’s collider, which is start inside of anyway. Repeating the same raycast over and over it’s a total hit and miss. I’ve added kinematic rigidbody, tried it without, etc. It hits then it doesn’t hit, then it doesn’t hit, then it hits again.

I’m totally confused. I’ll start testing with a simple box collider but… there are literally no factors changing between the times it hits and the times it misses…?

			if (Input.GetKeyDown(KeyCode.Q)) {
				Ray harvestRay = new Ray(camTarget.position, cam.transform.forward);
				hit = new RaycastHit();
				if (Physics.Raycast(harvestRay, out hit, 3f, nonplayerMask)) {
					Debug.DrawRay(harvestRay.origin, hit.point - harvestRay.origin, Color.green, 5f);
				}
				else {
					Debug.DrawRay(harvestRay.origin, cam.transform.forward * 3f, Color.red, 5f);
				}
			}

Found my error =/

nonplayerMask = ~nonplayerMask;

This line of code, which was originially right after

nonplayerMask = 1 << 10;

was left over further down in my script from when I moved the mask generation out of Update() into Start(). Being cast from inside the player the ray was unable to hit anything on the frames that the nonPlayerMask was actually a playerOnlyMask >_< Moving the Debug.DrawRay() to Update() to see what was going on helped me to look at all my code, not just what I -thought- was involved.

Thanks for the pointers @Bunny83