First thing I did was to check the Behavior Tree, where I saw that the TargetActor was set to None (previously, before fiddling with the base c++ class, everything was working fine, just for reference). Indeed, I check whether the target actor exists and is outside of the attack range. If this condition is met, a move in range task is executed. However, the TargetActor is null/none, which is caused by the SphereOverlapActor for some reason ignoring the castle.
To be clear: This behavior tree is working as intended with another type of building (which has a different base class) and enemy soldiers (which share the same base class with the castle).