I just tested it with your script. Running it on M1, all is fine: timestamps do look to be end of bar and closes in the log coincide with raw data.

However, running the script with BarPeriod=5 shows there is a problem with larger bar construction (see attached).

Cockroach?

Attached Files
Zorro_1min_bars.PNG (9 downloads)
Zorro_5min_bars.PNG (8 downloads)