vtkXdmfWriter does not write correctly for vtkPythonAlgorithm

I wrote a custom Filter by subclassing VTKPythonAlgorithmBase following this link. When I write the output using vtkXMLPolyDataWriter class, I get correct points, lines and point-data vectors. I confirmed it by opening the output file in ParaView. But when I use vtkXdmfWriter (from vtkmodules.vtkIOXdmf2) using vtkXdmfWriter.WriteAllTimeStepsOn() followed by Write(), all my point-data vector arrays become scalar arrays i.e. their shape changes from (50, 3) to (150,). The connectivity of cells also gets messed up. My suspicion is that in my custom filter I am not setting some meta data that the vtkXdmfWriter might need. Does anyone know where I can find this information?