Raycast bypassing more than its excluded folder

I am trying to find a best way to make a linear projectile, and while i was trying the heartbeat raycast method, and this happened

why does raycast bypass the wall when there is a raycast excluded part in front of it?