The scheduler stores date/times without time zone information. This is then compativle with the epoch value sent from the Presentation Engine.
The dispatcher decides which events need to be executed my using a SQL localtime comparison in several places. This causes several problems. The worst is where the template is deciding how long to sleep. The sleep calculation uses the localtime and the SQL to get the next event to run correctly uses the AT TIME ZONE 'UTC' form.
In this scenario, with appropriately timed events, the template checks for scheduled events, finds none and calculates how long to sleep. This calculation comes back as '0' seconds and so it again attempts to see what is due to be scheduled. This effectively locks the template in an infinite loop.
Replace ALL references to localtime in the template with correct references to a time zone less value.