Let me explain.

I was playing the italian city states game from RR/RC last but one compilation.
The problem isn't (I think) related to that mod.

What happened was I was moving a unit of swordsmen across a stone gateway (Zagreb as Hungarian fortress) (the inner gateway, not the outer one) from one side to the other when they were on the wall already.

However a few of them descended to ground level and then ascended the other side not using the proper doorway but went up where the portcullis is.

Weird.