In the World Tree (WT) expansion, there is a script that changes the terrain in underground battles to the appropriate one; this is known as the Inferno script (it's the second-to-last one in the script91.erm file).
It works as follows: before the battle, it moves the coordinates of the battle location to the surface and changes the terrain type to the required one. After the battle, it restores the original terrain type on the surface.
It's likely that the coordinates of the battle didn't change on one side, which is why the battlefields are different.
I think it would be easier to fix this bug by patching the WT executable.
This script was one of the first I created, and it more or less handled its function when playing without the HD mod. Although, even then, bugs occurred, but I fixed it as I went along, as far as I remember.
It should be noted that this script is necessary for mirror maps, so it cannot be completely removed.
You could try asking Wizard how he solved the terrain type issue in underground battles for the SODO mirror map.
In my opinion, many WT incompatibilities with HD are easier to fix on the WT side if that's the goal. In particular, the incompatibility of HD with mirror maps. If necessary, the source code for the mirror map is still intact.