Sounds like based on the amount of light when it goes from day to night is causing it to lose it's focus. There needs to be enough light for it to focus on something and I seem to recall from helping you out in other posts that you are in a rural setting, so it can be pretty dark. Sometimes the field of view of a particular camera can be problematic with focus at night. I have one that would struggle with a fire hydrant in the field of view and was having trouble deciding what to focus on.
You could try changing it to manual focus and physically set the focus and that "should" hold it for the next night if you are running the firmware that added that feature.
Or do one of the three things many of us do:
Either force it to change profile based on a schedule 45 minutes prior to sunset so that there is enough light for it to focus when it goes to night mode. This would mean you have to periodically go in and adjust.
Just run it in B/W 24/7.
Or use this program that will force a zoom/focus based on the numbers we set.
Revisiting this. Any chance an update can get the focus/zoom of the particular PTZ I'm using? (SD49225T-HN) But it should be pretty straightforward for you to find the API docs and send off the request yourself in a web browser to get the zoom/focus numbers.
ipcamtalk.com