Hi,
I have been testing a bit and
Actually when the raycast enters a collider it will not see it any more (not in the center)
Yes you can see the raycast on debug, but it will only register the 1st object hit
(unless you are using layer mask)
There is also a custom action (raycast 2) that can also do something when nothing is hit, that might be useful.
A solution might be to adjust your player collider so that the raycast can't go against the wall, or move the raycast a bit deeper in the gun.