The factory should keep producing until its output queue is full, shouldn't it? It would make sense since the default state for a factory is to be full. If goods keeps disappearing from the output queue, there is something odd going on, because the code that removes goods from a factory should also put it somewhere.
Have you saved and reloaded after deleting all stops and vehicles? It could be that goods in transit that disappears because the station/vehicle they're on is deleted, don't register with the goods-in-transit monitoring system that they are gone. Or that the attempt to notify fails because they have an invalid destination.
I think we should focus on the why the trains stopped loading in the first place. The rest might just be false leads or things that don't work because the data is already messed up by something else.