The Germans tended to reuse names of children who died prior to the birth of the next one of the same sex. Johan Peter Dietz was the second son of Johan Georg and Anna Maria Gilch Dietz. Peter died. The third son, who followed Johan Peter, was named Georg Peter.
The feminine version of a name could also be used if the child following one who died was the opposite sex. ie; Emilie may be used if an Emil died and vice versa.
Of course the Germans frequently used Johan or Johann/Johannes as a first name for all males.