I encountered this situation in a battle with monsters, it's funny, but I have a question - if such a situation occurs in a battle between players, and a player, for example, with a clearly smaller army but with a red ball and the first turn, starts to exploit a cell - is this even allowed?
So, with the help of this program, I even found quite a few of these "cheating" battlefields (mainly where two-cell units cannot reach a one-cell unit, but there are also similar ones to the picture from the quoted post, with a cell that is completely inaccessible for melee attacks.
Here is a map that collects the combinations of coordinates and terrain that I found, and they were collected manually by simply viewing several thousand battlefields in my program.
I could find all these combinations, but I just don't have time to write an algorithm to search for a path across the battlefield map and run through all possible cells on the map.