The underlying issue is PipelineFile.dump() having unsafe design and breaking polymorphism. Here the suffix of the --file determines what class will be used as Dvcfile and while SingleStageFile.dump() indeed dumps the stage, PipelineFile.dump() does not by default.
This issue caused #3907 and was explained there in more detail. It may cause other undiscovered and future issues.