@bron,
It is
stylistically clumsy. Replacing "which" with "such that they" is one suggestion. No doubt you will get others.
NB Questions on this forum about
grammaticality usually assume on the traditional view that "grammar" is about the surface structure of "sentences". Hence in the above there is a potential surface clash between the single noun "castle" and the plural verb "are". But it is clear that the surface structure does not adequately reflect the intended
meaning which is associated with what Chomsky called "deep structure" in
his views on "grammar". So for a non-native speaker (say) who is used to his own mappings from deep to surface structure (involving say different word orders to English) problems in surface structure tend to occur which native speakers identify as "unacceptable". The word "ungrammatical" is often used for that lack of acceptability.