Energy is the only thing that matters. Friction is ignored and the string's tension does no work, so the bob's mechanical energy is conserved throughout the swing: including the moment the string catches on the peg.
A and B are at the same height. They are the two ends of the free swing, so the bob is momentarily at rest at each, and both lie at the same height above the lowest point.
Where D must be. Released from rest at A, the bob again comes to rest when it has climbed back to the same height. The peg shortens the radius, so D is nearer the peg and the arc is tighter, but the height is unchanged.
So D lies on the horizontal line AB. (It is not B itself, because the shorter radius means a larger angular swing.)
(A)