A superconductor-semiconducting nanowire-superconductor heterostructure in the presence of spin orbit coupling and magnetic field can support a supercurrent even in the absence of phase difference between the superconducting electrodes. We investigate this phenomenon, the anomalous Josephson effect, employing a model capable of describing many bands in the normal region. We discuss geometrical and symmetry conditions required to have finite anomalous supercurrent and in particular we show that this phenomenon is enhanced when the Fermi level is located close to a band opening in the normal region.