Can you try if this patch helps?
Worked fine in a test game. Train 1 rolled into an empty station and waited as it should. Then, it filled up as ships came in.
Thanks for testing.
Trains sometimes "leave early", but openttd has had that little oddity for years. It goes like this:
1. Train come into a station with (multiple) refit orders. Perhaps all wagons are empty and currently fit for "building materials".
2. Train pick up 12t of sand (half a car) and 50t of gravel/rocks (exactly two full cars). A few empty wagons (still fit for building materials) remains.
3. Train has orders to wait for one full load, and decides that this goal is met because the only two cars fit for gravel are completely full. This is wrong, because the train has empty wagons that can be refit for more gravel. So the train leaves with lots of empty cars.
That is hard to solve, due to the NewGRF autorefit specification. Essentially, you want a "full load any" order to wait if there are still empty wagons that could be refitted to one of the cargoes already loaded into the consist, but we do not know if that is possible until we try (the NewGRF could refuse the refit for whatever reasons). Also remember that it is possible to have an order to refit to A, B or C where each wagon can be refitted to a different subset of them, even none. I do not see a clean way to implement this.
Oh a new version
Guess with the fixes you did on Haftings bug report.
You should have waited a bit longer—now there is a newer one.
It fixes this bug
reported by Hafting. There are also some blitter-related changes in an area where we already had crashes on 64-bit systems in the past, so testing would be welcome (I still do not have a way to test 64-bit platforms).