When I run your program, it prints these errors:
vtkHDFWriter.cxx:1451 ERR| vtkHDFWriter (0x55f6c67f5fe0): Could not retrieve assembly from composite vtkPartitionedDataSetCollection
vtkHDFWriter.cxx:403 ERR| vtkHDFWriter (0x55f6c67f5fe0): Can't write vtkDataObjectTree to file:test.vtkhdf
Perhaps your PDC needs a vtkDataAssembly in order to work with vtkHDFWriter?