My guess is that the mess ultimately happened because, as the project developed, the systematization of resources, for various reasons, changed at different stages of development, and there was simply no time to adapt the old, already implemented materials to the new structure.
I am not criticizing the developers in any way. They were primarily focused on making a working game, not a beautiful and user-friendly file structure.
Something similar could have happened with the code, since the reasons for the changes in the file structure could well have affected changes in the code structure as well. I'm not an expert in this, and I'm just making an assumption.
As far as I know, the AI programmer was also the studio director, and he didn't really bother with programming; he could go for several days without starting work on the game...
Heroes 6 and 7 were full of stylistic, game design, and technical miscalculations, for which quite specific people are to blame..., some of whose decisions can only be described as arbitrary...
The fifth installment also didn't avoid them completely, but it still ended up in more capable hands. Nival, as a developer, had a well-coordinated team and extensive experience in creating games; they had already tested their game engine on several projects. And Fabris, as a producer, was clearly more reasonable...
But, in fact, Heroes 5 turned out to be more popular among fans of the series, who were already familiar with the game's mechanics and were able to appreciate the variety, etc., while the rest of the public (mainly foreign - and with purchasing power) criticized the game for being too difficult, with too much micromanagement, an unclear turn order scale, etc. Well, what do you expect after a change in the player generation...?)))
In addition, the culture of buyers has long changed; people read player reviews more than journalist reviews, and naturally, the game will first be bought by fans, and they will be the first to rush to criticize the game in reviews on various platforms, such as Steam, bringing down the game's rating. It was foolish not to think about this and release such buggy products, but you can't argue with marketers these days; they have the last word now... And the games turned out this way because of the technical specialists, whose experience and level of qualification were not sufficient for working on such a complex project as Heroes. And Ubisoft wanted to do it as cheaply as possible, but they probably didn't realize that they were just very lucky with Nival - the guys pulled a lot out of the fire with their enthusiasm...