Auto-translated
You have to be afraid of the AI. If you can't storm it right away or if you take losses while clearing a path to it, it's better not to engage. It also depends on which AI and what starting hero it has. I can justify Shakhti-Gosha very harshly... even in Castle.
When capturing an AI's Castle, if the AI's heroes are roaming off to the side, it's recommended to build a Citadel — this helps avoid unnecessary losses.
A couple of clever tricks regarding the AI:
1) If you really want the AI to fall under the walls of its own Castle, you need to dump your entire army into the garrison and leave your hero on just 1 fast unit. The AI attacks based on the army strength of the hero, without considering that the garrison will join during the siege, so it attacks almost always, even against a Citadel/Castle.
The second hero also attacks after the first one dies — apparently using the information about your hero's army from the start of the turn.
2) When your hero is close to its heroes/Castles, the computer calculates where you can reach without taking obstacles into account. That is, if you stand behind a guard that cannot be bypassed to reach the Castle, the AI "doesn't see" you and won't get scared and lock itself in the Castle. You can use this to capture its Castles for free. Often, when entering a teleport on one of the last tiles, I don't spend the remaining movement but stay overnight in the teleport.
If you do arrive at the Castle and it's locked down, you can lure it out in a similar way. For example, move far away down the path and place an artifact in front of you so that the Castle cannot be reached by going around it, but after picking it up, you can reach it on the last tile. Similarly, you can lock yourself in a dead end. Instead of an artifact, you can use a scout hero — the AI might run out to kill it, leaving the Castle undefended.
3) The AI does not account for the consequences of adding movement via Explorer, Spidy, and Merchant.