Wrong direction when using polarization analysis

i have a problem when calculating rockfalls azimuth ( that confirmed head into southwest based on visual observation)*, the result is in the range 165-167 degrees using the “stock” calculation from vidale_adapt and polarization_analysis, which is wrong because the station is in the northeast from the event, so the azimuth (which is backazimuth ±180 in function) must be in southwest.
i have tried different data with similar directions (southwest) that confirmed from visual observation too, but the result was always same in the range of 160-170 degree

i want to add some questions based on my question above.
is it because of the -+180 azimuth ambiguity that the function can’t calculate more than 180 degrees? can anyone give me information on how to resolve it? based on Jurkevics(1988), he said that we could use the sign function(eigenvector Z) to resolve it. but, when I implemented it in my calculation using np.sign(eigvencvector Z), the result is still same
here I attach how I change the code(vidale_adapt).


        azimuth = math.degrees(math.atan2
        eve = np.sqrt(eigvec[0][0].real ** 2 + eigvec[1][0].real ** 2)

        incidence = math.degrees(math.atan2(eve, -eigvec[2][0]))
        if azimuth < 0.0:
            azimuth = 360.0 + azimuth
        if incidence < 0.0:
            incidence += 180.0
        if incidence > 90.0:
            incidence = 180.0 - incidence   
            if azimuth > 180.0:
                azimuth -= 180.0
                azimuth += 180.0
        if azimuth > 180.0:
            azimuth -= 180.0