From the manual: "All date and time functions return 0 resp. invalid values in the initial run of the strategy since the bars and date ranges are not set up yet."

The time functions assume that the bar just ended. That's why you got the bar end time in the INITRUN, which is not in sync with the bars. In further runs the bar timestamp is just the current time.