While testing Autodrive with 1.1, I've loaded one of the old save games I made when we worked on making our mods compatible. That save had vehicles from different mods, among them Heavy trucks.
I had set up a piece of rail with 6 vehicle wagons. The heavy truck was loaded on the second wagon from the right. Now, the mod hasn't been updated for Factorio 1.1 yet, so the prototype doesn't exist in the game, you didn't create loaded-vehicle-wagon-truck, and the entity was removed by the json migration. Now, I have 4 wagons on the tracks, then a gap where this removed wagon used to be, and then the last wagon. This doesn't look nice in my case, but I guess it could seriously mess up real games where all of a sudden lone wagons block the rails because a they were disconnected from a train by removal of non-existing entities. Even worse: think of a train with locomotives on both ends. By removing one wagon from the train, you'd get two shorter trains, and I suppose that they might move in opposite directions …
Do you think it would be possible in on_configuration_changed? I guess you keep a list of your wagons, so when a mod has been removed, couldn't you check that all wagons in your list are still valid and replace them with an empty vehicle wagon otherwise? I've no idea if this would really work, though. It may be problematic to place a wagon on a curved rail, for example, and train IDs will change if you couple/decouple wagons. Still, you may want to consider this. :-)