Well, if your debug,Log inside the foreach loop isn’t executed, that just means your raycast didn’t hit anything and the Hits array is empty. The foreach loop does one iteration for each element in the array / collection. If there is no element in the array, the loop won’t execute.
Try printing the array length before your loop:
Debug.Log("Hit count: " + Hits.Length);
If it prints “Hit count: 0” you know that you simply don’t hit any collider.