Let me expand on my initial response and perhaps save you some time. When doing automated imaging, the session manager app (e.g. SGP) is always in control and PHD2 only does what it is told - no more, no less. PHD2 doesn't know anything at all about what is going on with your imaging session - focusing, centering, slewing to a new target, plate-solving, etc. The session manager tells it to start or stop guiding and that's about it other than start-up and shut-down actions. So if you think PHD2 is guiding when it shouldn't be or vice-versa, that is going to be a problem with how you've configured your session parameters. The session manager apps like SGP and NINA produce text log files that record what they are doing with each log entry time-stamped. So you need to figure out what time you had the problem, then find the session manager log and see what it was doing at that time. If you wanted guiding to be disabled, look to see if the session manager told it to stop. The logs are human-readable and you should be able to figure out what's going on without being a programmer. This is an important skill to have if you're trying to do automated, unattended imaging. Things will go wrong at times, that's just the norm.
Bruce