That is, I set up a random map, assigned factions, then set up the castles and started the game - the random map settings are reset. The team affiliation is lost.
And vice versa, if I first set up the castles and heroes, and then the map, and then start the game, the castles are reset.
Sometimes not all data is reset - for example, only the selected heroes may be reset, while the castle affiliation remains correct.