The reason was that the primary key in the de_variant_subject_idx table was not referenced anywhere, and it seems not to be possible in GORM to have a foreign key referencing something else than the primary key.
However, since the primary key field is quite useless, I have changed the domain model to take the dataset and subjectId as composite primary key, which makes mapping possible. See commit aeffbe3b985ce8ed0dd097addbf8a953fe27b964