FIX Pipeline should raise ValueError for duplicate name

It previously raised a TypeError because the construction of the
exception was done wrong. Fixes #2471.
MAINT list @paulgb's full name