Currently, the PrincipalAxisDirectionGenerator uses principal component analysis to determine the direction along the longest principal axis of the input mesh. When the input mesh is roughly a square, the direction chosen is often an axis that goes along the diagonal of the square mesh (which at times is undesirable) instead of along the axis of an oriented bounding box of the mesh (which seems closer to the intent of this direction generator).
Open3D has a method to get the minimum oriented bounding box of a mesh that can handle cases when the input mesh has similar length dimensions. This minimum oriented box defines the principal axes of the mesh sorted from longest to shortest. It should be possible to adapt this implementation to this direction generator.