Thanks for the report. Fixed in mod version 0.1.17.
Looks like the devs broke the train.schedule interface. If you read the schedule of a train with an empty schedule, it returns a non-nil table. If you then assign that empty schedule table back to the train, it causes this error.