It's freestanding, UK listed building rules are you cannot build extensions to the highest level listed buildings, but you can put up freestanding structures.
It's effectively a shed that happens to be touching the castle but isn't in any way attached to it