The passage in question comes from "Der Schimmelreiter" by Theodor Storm. Here it is:
[Er suchte] für ihn Arbeiten aus, die seinem noch nicht gefesteten Körper hätten gefährlich werden können.
My question is about the word order at the end of this sentence. Since a ",die ..."-type subordinate clause will send the verb to the end, we can unpack it as a full sentence like this:
[Diese] Arbeiten können seinem noch nicht gefesteten Körper hätten gefährlich werden.
This confuses me, however, because, as far as I am aware, the correct form is "[sie] hätten können", not the other way around, so the above sentence seems weird to me. In other words, I would have written it as
[Diese] Arbeiten hätten seinem noch nicht gefesteten Körper gefährlich werden können.
What is the reason for the original word swap? And what makes it correct?