In my opinion it is without question light (or lack thereof) combined with aperture.
The camera’s phase detection AF needs a certain amount of contrast to function. I had a similar experience not long ago using my bigma. It was around sundown and I noticed a rabbit eating on my neighbor’s lawn when returning from exercising with my dog. He seemed rather tolerant to our presence, so I ran in and got my camera that already had the 50-500 mounted. Wide open the bigma at 500mm is f/6.3 placing it at the upper end of performance for the phase detection AF. But I could reliably AF at that light level. As dusk approached AF began to become more and more variable until it got to a point where manual focus was required.
So my experience seems to be what you are describing, and that is as dusk approaches AF will become unreliable.