In RaycastModifier.ValidateLine, you use Physics.SphereCast for thick raycasts. But for some reason, Unity’s sphere casts ignore any collider that the sphere starts inside. This means that if you are right up against a wall with cast radius == agent radius, the sphere cast starts inside the wall and ignores that whole collider (on a box collider at least, I don’t know about other types), leading it to give you a path through the wall.
To fix this, I added the following line before the sphere cast:
if (Physics.CheckSphere(v1 + raycastOffset, thickRaycastRadius, mask)) return false;
Also, I remember reading somewhere that ray and sphere casts are more efficient if you use the overloads without a RaycastHit parameter.