1. You only can "win" the siege of Casterly Rock if you retreat and fight again.
If you play the Battle by yourselve it can't be finished because some Enemy soldiers (1-3) spawn out of the area you cant reach.
Own troops are walking against walls and rocks because they cant reach the remaining enemies just like the player himself.
2. It interrupts not only the possibility to conquer the Castle without using auto calc battle but also it will cost you a lot of troops because many of them stay at the entry looking for an unattainable soldier.
Greetings
This may bother you, but you should consider using "CTRL+ALT+F4" cheat to instantly knockout all enemies when you reach that point.
Moose has made some fixes for this so I will lock this thread.