Let's say you support castle B with troops from castle A.
You have losses and you lose the castle... When you want to heal troops, normally you got them back in castle A... now the troops are not coming back, so I suppose they come back in castle B.
But this castle isn't yours anymore.
In situation mentioned above, I think the troops belong to castle A. So when healed, they should be found in Castle A.
Could you take a look at this?
Best regards