>>282171958
His prosthetic legs were from a parasitic tree that feeds on humans. He gets rescued by the brim hats (who gave him the legs in the first place) but only after his father dies from the forbidden spell rewinding time to before his death finally running out. Tartah is shocked because the tree is the same kind that's in his shop and thus he's been unknowingly making magic ink out of people for years, so he betrays Coco and goes away with the brim hats too.

Qifrey reveals he also has a sprout of the tree in his eye socket due to the brim hats experimenting on him, which has already been implied in a previous flashback.