Dataset error undefined method `values' for nil:NilClass

I’m using a couple of datasets to construct what is effectively a many to many relationship.

Whenever I run the preview on the new schema, it works, If I download the data, it works, but when I try to generate a dataset, it fails with the above error