Writing to a file with a time trigger not reliable

I have a macro that writes to a file on my computer every 15 minutes. It generally works reliably but every few days ti stops working and I need to restart my computer to get it to work again. It always seems to stop working at 12:06am when it does stop working. I have no other Keyboard Maestro macros that operate around this time. I am trying to work out what causes it to stop working around this time. I can see it is this time from the time the file is last written to. I have checked the engine log but there is no detail in there. Anyone know how I can workout what is going on?

Have you tried to leave the debugger on at around this time to see if it triggers at all

I haven’t. I will give that a try.