How did you save the test.dataset and what’s your use case to store it?
Based on the posted code it seems you are lazily loading the data anyway, so storing the Dataset object might be unnecessary.
Are you seeing the same error, if you recreate the PatientDataset and pass it to the DataLoader?